Welcome to NeoOffice developer notes and announcements
NeoOffice
Developer notes and announcements
 
 

This website is an archive and is no longer active
NeoOffice announcements have moved to the NeoOffice News website


Support
· Forums
· NeoOffice Support
· NeoWiki


Announcements
· Twitter @NeoOffice


Downloads
· Download NeoOffice


  
NeoOffice :: View topic - NeoOffice/J now has printing
NeoOffice/J now has printing
 
   NeoOffice Forum Index -> NeoOffice Testing
View previous topic :: View next topic  
Author Message
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11949

PostPosted: Sat Aug 16, 2003 11:47 am    Post subject: NeoOffice/J now has printing

I finally finished implementing all of the printing functionality in NeoOffice/J! But I need help testing the new functionality.

If you are interested in testing the new printing functionality, you can download the lastest printing binaries and install them in an existing NeoOffice/J 0.0.1 installation using the following steps:

- If you have not already installed NeoOffice/J 0.0.1, download and install it from:
http://trinity.neooffice.org/modules.php?name=Downloads&d_op=viewdownload&cid=4
- Download the latest printing binaries from:
http://www.planamesa.com/neojava/downloads/temp/printtest3.tar.gz
- Open a new terminal and execute the following commands to unzip the file:
Code:
cd <NeoJ installation directory>/NeoOfficeJ.app
sudo tar zxvf <path to downloaded *.tar.gz file>

- Restart NeoJ

If you find any bugs or unexpected behavior, please post them here.

Patrick
Back to top
Max_Barel
Oracle


Joined: May 31, 2003
Posts: 219
Location: French Alps

PostPosted: Sun Aug 17, 2003 8:36 am    Post subject: No image printing

We already thank you for the great job you have done one Neo/J and printing. Now is the time of bug reports.

- No image printing. This one is surprising. After loading the printest3 tarball. I tested some file around and found that it does not print images at all. Jpeg or tiff are ignored, eps are printed as they are displayed i.e. as a markup of an eps file. Now, I guess why the PDF generated files are thinner than OOo/X11 ones! The test I reported in an other post contains two images.
- Modal dialog lock-up. When Neo/J is printing, if the underlying OOo thread pop a dialog, like transparency in image or paper size etc. The two dialogs lock each other and you can't click or close anyone. The main thread is still responding, but if you try to quit NJ it refuses because being printing. You must kill the app.
- No even-odd selection. This is not exactly a bug, rather an OS X lack. Switching to native OS X print dialog has the side effect of loosing the ability of select odd or even pages for double side printing. There is still the possibility to print to a PDF file and use Acrobat Reader trick to print the only odd or even (afaik, Preview can't).

About UI (of topic): Pluby, if you wish, I can post a small list of UI related bug or issues. I don't think it's now on you priority list so I'll wait for you to ask.
Back to top
Guest






PostPosted: Sun Aug 17, 2003 10:07 am    Post subject: Re: No image printing

Max,

Thanks for the feedback. It appears that I still have some work to do Sad.
Max_Barel wrote:
- No image printing. This one is surprising. After loading the printest3 tarball. I tested some file around and found that it does not print images at all. Jpeg or tiff are ignored, eps are printed as they are displayed i.e. as a markup of an eps file. Now, I guess why the PDF generated files are thinner than OOo/X11 ones! The test I reported in an other post contains two images.

I found that the Mac OS X's Java version asks each page to be printed twice. Since the OOo code expects to print each page only once, my print code only prints to the second copy. My guess is that I need to fool OOo into printing to both copies so that Java can merge these copies into one page.
Max_Barel wrote:
- Modal dialog lock-up. When Neo/J is printing, if the underlying OOo thread pop a dialog, like transparency in image or paper size etc. The two dialogs lock each other and you can't click or close anyone. The main thread is still responding, but if you try to quit NJ it refuses because being printing. You must kill the app.

It appears that I have not suppressed all of the OOo dialogs. Can you post the steps that caused these dialogs to appear? Then I can track them down and suppress them.
Max_Barel wrote:
- No even-odd selection. This is not exactly a bug, rather an OS X lack. Switching to native OS X print dialog has the side effect of loosing the ability of select odd or even pages for double side printing. There is still the possibility to print to a PDF file and use Acrobat Reader trick to print the only odd or even (afaik, Preview can't).

Was the even-odd selection in the OOo print dialog? IIRC, the OOo print dialog had an "Options" button and those options. Unfortunately, by suppressing the OOo print dialog, I made those options inaccessible so you always get the default options. I could change the code so that when you select the "File -> Print..." menu, you get a OOo print dialog with all of the options that are in the Java print dialog removed.

Patrick
Back to top
Max_Barel
Oracle


Joined: May 31, 2003
Posts: 219
Location: French Alps

PostPosted: Mon Aug 18, 2003 4:28 am    Post subject: Re: No image printing

pluby wrote:
Max_Barel wrote:
- Modal dialog lock-up. When Neo/J is printing, if the underlying OOo thread pop a dialog, like transparency in image or paper size etc...

It appears that I have not suppressed all of the OOo dialogs. Can you post the steps that caused these dialogs to appear? Then I can track them down and suppress them.

The first occurence was when trying to print a page with image transparency. I have one image, with a mask upon it which has transparency. The mask is a geometric shape to focus on a part of the underlying picture. While trying to make a simpler test file with just an image I ran into problems to reproduce the bug.
- First I noticed that any object, picture or geometric shape with transparency, do not display on screen (in fact display as transparent or white).
- Then, with a simpler file, the order in wich dialog pop up is different, probably issued by two distinct threads. On the simple file the transparency warning (OOo) pops up first, before the printing spinning status dialog. Then, being modal, it gives you the time to answer the warning, there is no locking. On the bigger file, after you hit the print button, the spinning dialog pops slightly before the warning, and the locks occurs. If you can't reproduce the problem, I can send you the file and the linked images.
This warning can be disabled in the Tools->Option->printing dialog pane. I suspect that other print warning dialog of this pane (paper size ) could also cause locks in some circumstances.

I also had another lock while printing a file causing a general error "all files will be saved etc..." then the error dialog locks with the printing spinning bar.
pluby wrote:
Max_Barel wrote:
- No even-odd selection.

Was the even-odd selection in the OOo print dialog? IIRC, the OOo print dialog had an "Options" button and those options. Unfortunately, by suppressing the OOo print dialog, I made those options inaccessible so you always get the default options. I could change the code so that when you select the "File -> Print..." menu, you get a OOo print dialog with all of the options that are in the Java print dialog removed.

Yes, I was talking about this options dialog. If you can keep those options without causing more trouble, it'd be nice.
Back to top
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11949

PostPosted: Mon Aug 18, 2003 7:35 am    Post subject:

Max,

I was able to replicate the "dialog lock-up problem". It seems that OOo has many cases when it will show a modal dialog after printing has started.

Since Java's printing APIs display the modal "Printing" dialog and modal Java dialog grab all mouse events, the only solution is that I must suppress the display of any OOo modal dialog once printing has started.

This solution is fairly easy to implement. But it will force the user to automatically get the default option associated with each modal dialog. I realize that this is not ideal. Any thoughts?

As for the options dialog that I already suppress, I will add that back when I implement the above fix.

Patrick
Back to top
OPENSTEP
The One
The One


Joined: May 25, 2003
Posts: 4752
Location: Santa Barbara, CA

PostPosted: Mon Aug 18, 2003 9:19 pm    Post subject:

Erk, I really do hate this dialog modality issue. I can only think of two approaches, the suppress all modal dialogs option as already mentioned as one. The other may be a bit trickier...

I know in Carbon/Cocoa print dialogs you can extend a print dialog with custom controls that show up in a subpanel. Theoretically, we might be able to do something along the lines of "queuing" any other modal dialogs until a user pressed an "Options" button within the print dialog. Then, the next modal dialog could enter its event loop off of the handler from the custom control. This may require some type of weird deferred wizadry in the base class dialog constructor...most client code seems to invoke "Execute" and assume that when it returns the dialog's options have been specified.

In theory, the print dialog should be handled by the primary run loop, so doing this wouldn't cause the event loop to start jumping to weird threads. I honestly think deferring the dialogs may just be too difficult, but in theory it may be the cleanest approach. Thoughts?

ed
Back to top
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11949

PostPosted: Mon Aug 18, 2003 9:32 pm    Post subject:

Ed,

Earlier today I came to same conclusion that deferring the printing dialogs was the most realistic approach. Fortunately, I found that I was creating the print dialog much earlier than necessary. So, instead of creating the print dialog in SalPrinter::StartJob, I now do it in the first call to SalPrinter::StartPage. This works like a charm.

Apparently, OOo invokes SalPrinter::StartJob and then does all of the checks that display modal dialogs. After all of the modal dialogs are displayed, OOo invokes SalPrinter::StartPage to get the first page to print to.

I have also fixed Max's other bugs (i.e. images and transparency). Fortunately, they weren't as bad as I thought they would be. I am doing a clean build of the installer. Expect to see an new posting and updated binaries in a couple hours.

Patrick
Back to top
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11949

PostPosted: Mon Aug 18, 2003 10:21 pm    Post subject:

I have posted an updated set of printing binaries. This new set of binaries fixes the following bugs that Max Barel reported in this same thread:

- Images don't print - Images now print (even transparent ones)
- Modal dialog lockup - Surpringly, I did not need to suppress the OOo dialogs that Max was seeing. Instead, I just delayed the start of Java's printing process. This allows the OOo dialogs to appear without any lockup.
- The OOo print options dialog never appears - I have reenabled this dialog when you select the File->Print... menu item.

Also, I added my fix for the OOo bug that mangles non-ASCII path names iin the OOo file dialogs.

If you are interested in testing the latest fixes, you can download the lastest printing binaries and install them in an existing NeoOffice/J 0.0.1 installation using the following steps:

- If you have not already installed NeoOffice/J 0.0.1, download and install it from:
http://trinity.neooffice.org/modules.php?name=Downloads&d_op=viewdownload&cid=4
- Download the latest printing binaries from:
http://www.planamesa.com/neojava/downloads/temp/printtest4.tar.gz
- Open a new terminal and execute the following commands to unzip the file:
Code:
cd <NeoJ installation directory>/NeoOfficeJ.app
sudo tar zxvf <path to downloaded *.tar.gz file>

- Restart NeoJ

If you find any bugs or unexpected behavior, please post them here.

Patrick
Back to top
Max_Barel
Oracle


Joined: May 31, 2003
Posts: 219
Location: French Alps

PostPosted: Fri Aug 22, 2003 5:00 am    Post subject: printest4 preliminary report

Hi Patric,
I have been too busy these days to do extensive testing of the printest4 improvements.
Nevertheless here are a few remarks:
- No printing of EPS images. This version brings no improvement on this matter. OOo never displayed EPS on screen but included the EPS in the PostScript stream. Neo/J does not. Instead it prints the thumbnail used for displaying the EPS placeholder. Loosing the PS font capability isn't too serious, but embedding EPS is a useful feature to keep, if possible.
- The PDF file generated by this last version hangs Preview. If a PDF file is generated and saved using option in the standard print dialog, it can be opened and displayed with Acrobat Reader, but not in Preview. I presume this is a PDF 1.2/1.3 issue, because if the generated file is filtered by ps2pdf, it then opens in Preview. This is not major concern but still a hitch in the normal Cocoa print sequence edit-preview-print.
- One of my graphic files cause Neo/J to crash, while printing correctly in OOo/X11. I have no clue on this (buffer size?). Here under a crash dump. Notice that this is the kind of crash where OO display a message "all files have been saved...", but, in Neo/J, the next launch does not offer the option to recover the temp file.
- I also noticed that Neo/J always prints the whole file, even if only some page is selected. We can cope with this, if it's the simple way to print in Java. Also when the print process is canceled from the Cocoa progress window, this one close but Neo/J continue printing to the end.

Neo/J is now very close to replace OOo/X11 for everyday work (keeping it at hand just in case), while the Neo team works on the Aqua port.

Code:

Date/Time:  2003-08-19 15:00:31 +0200
OS Version: 10.2.6 (Build 6L60)
Host:       grogro.local.

Command:    soffice.bin
PID:        5009

Exception:  EXC_BAD_ACCESS (0x0001)
Codes:      KERN_PROTECTION_FAILURE (0x0002) at 0x00000000

Thread 0 Crashed:
 #0   0x00e0bdbc in SalBitmap::AcquireBuffer(unsigned char)
 #1   0x00ceefdc in ImpBitmap::ImplAcquireBuffer(unsigned char)
 #2   0x00cd84a8 in BitmapReadAccess::ImplCreate(Bitmap &)
 #3   0x00cd82cc in BitmapReadAccess::BitmapReadAccess(Bitmap &, unsigned char)
 #4   0x00cc0a54 in Bitmap::AcquireWriteAccess(void)
 #5   0x0994b360 in JPEGReader::CreateBitmap(void *)
 #6   0x09a3b430 in ReadJPEG
 #7   0x0994bb9c in JPEGReader::Read(Graphic &)
 #8   0x0994c1c0 in ImportJPEG(SvStream &, Graphic &, void *, long)
 #9   0x09927288 in GraphicFilter::ImportGraphic(Graphic &, String const &, SvStream &, unsigned short, unsigned short *, unsigned long)
 #10  0x07f56798 in SvFileObject::GetGraphic_Impl(Graphic &, SvStream *)
 #11  0x07f55bc0 in SvFileObject::GetData(com::sun::star::uno::Any &, String const &, unsigned char)
 #12  0x06f19f20 in so3::SvLinkSource::NotifyDataChanged(void)
 #13  0x07f56d8c in SvFileObject::LoadGrfReady_Impl(SvFileObject *, void *)
 #14  0x09a3799c in Link::Call(void *) const
 #15  0x09a378f4 in svtools::AsynchronLink::Call_Impl(void *)
 #16  0x09a3779c in svtools::AsynchronLink::HandleCall(svtools::AsynchronLink *, void *)
 #17  0x00daa150 in Link::Call(void *) const
 #18  0x00da8d9c in ImplHandleUserEvent(ImplSVEvent *)
 #19  0x00da99d8 in ImplWindowFrameProc(void *, SalFrame *, unsigned short, void const *)
 #20  0x00e11cec in vcl::com_sun_star_vcl_VCLEvent::dispatchEvent(unsigned short, SalFrame *, void *)
 #21  0x00e11c60 in vcl::com_sun_star_vcl_VCLEvent::dispatch(void)
 #22  0x00e0e324 in SalInstance::Yield(unsigned char)
 #23  0x00caf2cc in Application::Reschedule(void)
 #24  0x07f55ad0 in SvFileObject::GetData(com::sun::star::uno::Any &, String const &, unsigned char)
 #25  0x08343c78 in SdrGraphicLink::UpdateSynchron(void)
 #26  0x08344a98 in SdrGrafObj::ImpUpdateGraphicLink(void) const
 #27  0x08345e74 in SdrGrafObj::Paint(ExtOutputDevice &, SdrPaintInfoRec const &) const
 #28  0x0838ce60 in SdrObjList::Paint(ExtOutputDevice &, SdrPaintInfoRec const &, int, unsigned short) const
 #29  0x0838c68c in SdrObjList::Paint(ExtOutputDevice &, SdrPaintInfoRec const &, int) const
 #30  0x083987b4 in SdrPageView::InitRedraw(OutputDevice *, Region const &, unsigned short, Link const *)
 #31  0x083a595c in SdrPaintView::InitRedraw(OutputDevice *, Region const &, unsigned short)
 #32  0x117f136c in SdView::InitRedraw(OutputDevice *, Region const &)
 #33  0x11839620 in SdDrawView::InitRedraw(OutputDevice *, Region const &)
 #34  0x11817f80 in SdDrawViewShell::Paint(Rectangle const &, SdWindow *)
 #35  0x1180ba24 in SdWindow::Paint(Rectangle const &)
 #36  0x00d8e6a0 in Window::ImplCallPaint(Region const *, unsigned short)
 #37  0x00d8e7d8 in Window::ImplCallPaint(Region const *, unsigned short)
 #38  0x00d8e7d8 in Window::ImplCallPaint(Region const *, unsigned short)
 #39  0x00d8e7d8 in Window::ImplCallPaint(Region const *, unsigned short)
 #40  0x00d8e7d8 in Window::ImplCallPaint(Region const *, unsigned short)
 #41  0x00d8e7d8 in Window::ImplCallPaint(Region const *, unsigned short)
 #42  0x00d8e7d8 in Window::ImplCallPaint(Region const *, unsigned short)
 #43  0x00d8e904 in Window::ImplCallOverlapPaint(void)
 #44  0x00d8e9dc in Window::ImplHandlePaintHdl(void *)
 #45  0x00d8e988 in Window::LinkStubImplHandlePaintHdl(void *, void *)
 #46  0x00cb509c in Timer::Timeout(void)
 #47  0x00cb4e24 in ImplTimerCallbackProc(void)
 #48  0x00e0e248 in SalInstance::Yield(unsigned char)
 #49  0x00caf3a0 in Application::Yield(void)
 #50  0x00caf22c in Application::Execute(void)
 #51  0x00008344 in Desktop::Main(void)
 #52  0x00cb39f4 in SVMain(void)
 #53  0x00e0db1c in main
 #54  0x000022b0 in _start
 #55  0x000020e0 in start

Thread 1:
 #0   0x90042688 in semaphore_timedwait_signal_trap
 #1   0x9003e8b4 in _pthread_cond_wait
 #2   0x0029ae58 in osl_waitCondition
 #3   0x007efe6c in store::OStorePageDaemon_Impl::run(void)
 #4   0x007f09b8 in threadFunc
 #5   0x0029f570 in osl_thread_start_Impl
 #6   0x90020d48 in _pthread_body

Thread 2:
 #0   0x90042688 in semaphore_timedwait_signal_trap
 #1   0x9003e8b4 in _pthread_cond_wait
 #2   0x0029ae58 in osl_waitCondition
 #3   0x000f5304 in vos::OCondition::wait(TimeValue const *)
 #4   0x000feae4 in vos::OTimerManager::run(void)
 #5   0x000fb550 in vos::_cpp_OThread_WorkerFunction(void *)
 #6   0x0029f570 in osl_thread_start_Impl
 #7   0x90020d48 in _pthread_body

Thread 3:
 #0   0x9003eaa8 in semaphore_wait_signal_trap
 #1   0x9003e8c4 in _pthread_cond_wait
 #2   0x0029ae8c in osl_waitCondition
 #3   0x010db7a4 in osl::Condition::wait(TimeValue const *)
 #4   0x010cca14 in stoc_javavm::OCreatorThread::run(void)
 #5   0x010deb90 in threadFunc
 #6   0x0029f570 in osl_thread_start_Impl
 #7   0x90020d48 in _pthread_body

Thread 4:
 #0   0x90073c48 in mach_msg_trap
 #1   0x90005f90 in mach_msg
 #2   0x928ec28c in JNI_CreateJavaVM_Impl
 #3   0x928ec224 in JNI_CreateJavaVM_Impl
 #4   0x928a51fc in JVM_GetClassMethodsCount
 #5   0x90020d48 in _pthread_body

Thread 5:
 #0   0x90073c48 in mach_msg_trap
 #1   0x90005f90 in mach_msg
 #2   0x9283de9c in JVM_NewInstance
 #3   0x9285eae4 in JVM_FillInStackTrace
 #4   0x928647a0 in JVM_Send
 #5   0x9290114c in JNI_CreateJavaVM_Impl
 #6   0x928a51fc in JVM_GetClassMethodsCount
 #7   0x90020d48 in _pthread_body

Thread 6:
 #0   0x90073c48 in mach_msg_trap
 #1   0x90005f90 in mach_msg
 #2   0x9283ddf4 in JVM_NewInstance
 #3   0x92845d80 in JVM_ArrayCopy
 #4   0x9285d620 in JVM_MonitorNotify
 #5   0x9285e2f8 in JVM_MonitorWait
 #6   0x02cd74bc in 0x2cd74bc
 #7   0x02ce8780 in 0x2ce8780
 #8   0x02d2afec in 0x2d2afec
 #9   0x02c90e60 in 0x2c90e60
 #10  0xa2843c38 in typeinfo name for std::bad_exception
 #11  0x92838bdc in JVM_CurrentTimeMillis
 #12  0x92878c28 in JVM_FindClassFromClass
 #13  0x92892c90 in JVM_IsSameClassPackage
 #14  0x9288cf70 in JVM_GetMethodIxExceptionTableEntry
 #15  0x928787a0 in JVM_FindClassFromClass
 #16  0x928a51fc in JVM_GetClassMethodsCount
 #17  0x90020d48 in _pthread_body

Thread 7:
 #0   0x90073c48 in mach_msg_trap
 #1   0x90005f90 in mach_msg
 #2   0x9283ddf4 in JVM_NewInstance
 #3   0x92845d80 in JVM_ArrayCopy
 #4   0x9285d620 in JVM_MonitorNotify
 #5   0x9285e2f8 in JVM_MonitorWait
 #6   0x02cd74bc in 0x2cd74bc
 #7   0x02d118c8 in 0x2d118c8
 #8   0x02d11648 in 0x2d11648
 #9   0x02d2bf2c in 0x2d2bf2c
 #10  0x02c90e60 in 0x2c90e60
 #11  0xa2843c38 in typeinfo name for std::bad_exception
 #12  0x92838bdc in JVM_CurrentTimeMillis
 #13  0x92878c28 in JVM_FindClassFromClass
 #14  0x92892c90 in JVM_IsSameClassPackage
 #15  0x9288cf70 in JVM_GetMethodIxExceptionTableEntry
 #16  0x928787a0 in JVM_FindClassFromClass
 #17  0x928a51fc in JVM_GetClassMethodsCount
 #18  0x90020d48 in _pthread_body

Thread 8:
 #0   0x90073c48 in mach_msg_trap
 #1   0x90005f90 in mach_msg
 #2   0x9283de9c in JVM_NewInstance
 #3   0x92844e18 in JVM_GetClassLoader
 #4   0x92844ba4 in JVM_GetClassLoader
 #5   0x928a51fc in JVM_GetClassMethodsCount
 #6   0x90020d48 in _pthread_body

Thread 9:
 #0   0x90073c48 in mach_msg_trap
 #1   0x90005f90 in mach_msg
 #2   0x9283ddf4 in JVM_NewInstance
 #3   0x9285eb40 in JVM_FillInStackTrace
 #4   0x92903300 in JVM_InitProperties
 #5   0x92903138 in JVM_InitProperties
 #6   0x928787a0 in JVM_FindClassFromClass
 #7   0x928a51fc in JVM_GetClassMethodsCount
 #8   0x90020d48 in _pthread_body

Thread 10:
 #0   0x90073c48 in mach_msg_trap
 #1   0x90005f90 in mach_msg
 #2   0x9283ddf4 in JVM_NewInstance
 #3   0x9285eb40 in JVM_FillInStackTrace
 #4   0x9288890c in JVM_StartThread
 #5   0x92876c10 in JVM_FindLoadedClass
 #6   0x928787a0 in JVM_FindClassFromClass
 #7   0x928a51fc in JVM_GetClassMethodsCount
 #8   0x90020d48 in _pthread_body

Thread 11:
 #0   0x90073c48 in mach_msg_trap
 #1   0x90005f90 in mach_msg
 #2   0x901489f0 in __CFRunLoopRun
 #3   0x90180f58 in CFRunLoopRunSpecific
 #4   0x969a3b70 in RunCurrentEventLoopInMode
 #5   0x969b3b00 in ReceiveNextEventCommon
 #6   0x969f2b5c in _AcquireNextEvent
 #7   0x96ab4cf8 in RunApplicationEventLoop
 #8   0x940b1444 in initializeStandaloneThread(int)
 #9   0x90020d48 in _pthread_body

Thread 12:
 #0   0x90073c48 in mach_msg_trap
 #1   0x90005f90 in mach_msg
 #2   0x9283ddf4 in JVM_NewInstance
 #3   0x92845d80 in JVM_ArrayCopy
 #4   0x9285d620 in JVM_MonitorNotify
 #5   0x9285e2f8 in JVM_MonitorWait
 #6   0x02b90668 in 0x2b90668
 #7   0x02b8e68c in 0x2b8e68c
 #8   0x02b8e68c in 0x2b8e68c
 #9   0x02b8e5cc in 0x2b8e5cc
 #10  0x02b8e5cc in 0x2b8e5cc
 #11  0x02b8e68c in 0x2b8e68c
 #12  0x02b8e68c in 0x2b8e68c
 #13  0xa2843c38 in typeinfo name for std::bad_exception
 #14  0x92838bdc in JVM_CurrentTimeMillis
 #15  0x92878c28 in JVM_FindClassFromClass
 #16  0x92892c90 in JVM_IsSameClassPackage
 #17  0x9288cf70 in JVM_GetMethodIxExceptionTableEntry
 #18  0x928787a0 in JVM_FindClassFromClass
 #19  0x928a51fc in JVM_GetClassMethodsCount
 #20  0x90020d48 in _pthread_body

Thread 13:
 #0   0x90073c48 in mach_msg_trap
 #1   0x90005f90 in mach_msg
 #2   0x9283ddf4 in JVM_NewInstance
 #3   0x92845d80 in JVM_ArrayCopy
 #4   0x9285d620 in JVM_MonitorNotify
 #5   0x9285e2f8 in JVM_MonitorWait
 #6   0x02cd74bc in 0x2cd74bc
 #7   0x02ce8780 in 0x2ce8780
 #8   0x02b8e68c in 0x2b8e68c
 #9   0xa2843c38 in typeinfo name for std::bad_exception
 #10  0x92838bdc in JVM_CurrentTimeMillis
 #11  0x92878c28 in JVM_FindClassFromClass
 #12  0x92892c90 in JVM_IsSameClassPackage
 #13  0x9288cf70 in JVM_GetMethodIxExceptionTableEntry
 #14  0x928787a0 in JVM_FindClassFromClass
 #15  0x928a51fc in JVM_GetClassMethodsCount
 #16  0x90020d48 in _pthread_body

Thread 14:
 #0   0x90073c48 in mach_msg_trap
 #1   0x90005f90 in mach_msg
 #2   0x9283ddf4 in JVM_NewInstance
 #3   0x92845d80 in JVM_ArrayCopy
 #4   0x9285d620 in JVM_MonitorNotify
 #5   0x9285e2f8 in JVM_MonitorWait
 #6   0x02cd74bc in 0x2cd74bc
 #7   0x02ce8780 in 0x2ce8780
 #8   0x02cca048 in 0x2cca048
 #9   0x02ce6fc8 in 0x2ce6fc8
 #10  0x02ce7f94 in 0x2ce7f94
 #11  0x02c90e60 in 0x2c90e60
 #12  0x02b8e68c in 0x2b8e68c
 #13  0x02b8e68c in 0x2b8e68c
 #14  0xa2843c38 in typeinfo name for std::bad_exception
 #15  0x92838bdc in JVM_CurrentTimeMillis
 #16  0x92878c28 in JVM_FindClassFromClass
 #17  0x92892c90 in JVM_IsSameClassPackage
 #18  0x9288cf70 in JVM_GetMethodIxExceptionTableEntry
 #19  0x928787a0 in JVM_FindClassFromClass
 #20  0x928a51fc in JVM_GetClassMethodsCount
 #21  0x90020d48 in _pthread_body

Thread 15:
 #0   0x9003142c in accept
 #1   0x002aa474 in osl_acceptPipe
 #2   0x001008a4 in vos::OPipe::accept(vos::OStreamPipe &)
 #3   0x0001712c in desktop::OfficeIPCThread::run(void)
 #4   0x000fb550 in vos::_cpp_OThread_WorkerFunction(void *)
 #5   0x0029f570 in osl_thread_start_Impl
 #6   0x90020d48 in _pthread_body

Thread 16:
 #0   0x90073c48 in mach_msg_trap
 #1   0x90005f90 in mach_msg
 #2   0x9283ddf4 in JVM_NewInstance
 #3   0x92845d80 in JVM_ArrayCopy
 #4   0x9285d620 in JVM_MonitorNotify
 #5   0x9285e2f8 in JVM_MonitorWait
 #6   0x02cd74bc in 0x2cd74bc
 #7   0x02ce8780 in 0x2ce8780
 #8   0x02b8e68c in 0x2b8e68c
 #9   0x02b8e5cc in 0x2b8e5cc
 #10  0xa2843c38 in typeinfo name for std::bad_exception
 #11  0x92838bdc in JVM_CurrentTimeMillis
 #12  0x92878c28 in JVM_FindClassFromClass
 #13  0x92892c90 in JVM_IsSameClassPackage
 #14  0x9288cf70 in JVM_GetMethodIxExceptionTableEntry
 #15  0x928787a0 in JVM_FindClassFromClass
 #16  0x928a51fc in JVM_GetClassMethodsCount
 #17  0x90020d48 in _pthread_body

Thread 17:
 #0   0x90073c48 in mach_msg_trap
 #1   0x90005f90 in mach_msg
 #2   0x9283ddf4 in JVM_NewInstance
 #3   0x92845d80 in JVM_ArrayCopy
 #4   0x9285d620 in JVM_MonitorNotify
 #5   0x9285e2f8 in JVM_MonitorWait
 #6   0x02cd74bc in 0x2cd74bc
 #7   0x02ce8780 in 0x2ce8780
 #8   0x02b8e68c in 0x2b8e68c
 #9   0xa2843c38 in typeinfo name for std::bad_exception
 #10  0x92838bdc in JVM_CurrentTimeMillis
 #11  0x92878c28 in JVM_FindClassFromClass
 #12  0x92892c90 in JVM_IsSameClassPackage
 #13  0x9288cf70 in JVM_GetMethodIxExceptionTableEntry
 #14  0x928787a0 in JVM_FindClassFromClass
 #15  0x928a51fc in JVM_GetClassMethodsCount
 #16  0x90020d48 in _pthread_body

Thread 18:
 #0   0x90073c48 in mach_msg_trap
 #1   0x90005f90 in mach_msg
 #2   0x9283ddf4 in JVM_NewInstance
 #3   0x92845d80 in JVM_ArrayCopy
 #4   0x9285d620 in JVM_MonitorNotify
 #5   0x9285e2f8 in JVM_MonitorWait
 #6   0x02cd74bc in 0x2cd74bc
 #7   0x02ce8780 in 0x2ce8780
 #8   0x02b8e68c in 0x2b8e68c
 #9   0x02b8e5cc in 0x2b8e5cc
 #10  0xa2843c38 in typeinfo name for std::bad_exception
 #11  0x92838bdc in JVM_CurrentTimeMillis
 #12  0x92878c28 in JVM_FindClassFromClass
 #13  0x92892c90 in JVM_IsSameClassPackage
 #14  0x9288cf70 in JVM_GetMethodIxExceptionTableEntry
 #15  0x928787a0 in JVM_FindClassFromClass
 #16  0x928a51fc in JVM_GetClassMethodsCount
 #17  0x90020d48 in _pthread_body

Thread 19:
 #0   0x9003eaa8 in semaphore_wait_signal_trap
 #1   0x9003e8c4 in _pthread_cond_wait
 #2   0x06d52890 in fileaccess::StatusFiller::run(void *)
 #3   0x06d520fc in runThread
 #4   0x90020d48 in _pthread_body

PPC Thread State:
  srr0: 0x00e0bdbc srr1: 0x0000f930                vrsave: 0x00000000
   xer: 0x00000000   lr: 0x00e0bd9c  ctr: 0x92904550   mq: 0x00000000
    r0: 0x00e0bd9c   r1: 0xbfffd8d0   r2: 0x00000000   r3: 0x09fb9d40
    r4: 0x09fb9cd0   r5: 0xbfffd90c   r6: 0x00000005   r7: 0x00000007
    r8: 0x00000000   r9: 0xa283454c  r10: 0x00000000  r11: 0x00000000
   r12: 0x00e0fdb4  r13: 0x00000002  r14: 0x00000001  r15: 0x00000000
   r16: 0x00000000  r17: 0x0c6c2780  r18: 0x00000000  r19: 0x0c6c2780
   r20: 0xbfffe358  r21: 0x00000000  r22: 0x00000000  r23: 0x10eff0b4
   r24: 0xbfffe09c  r25: 0x10eff0a0  r26: 0x10eff0b4  r27: 0x10efe0a0
   r28: 0x132ba9e0  r29: 0x00000000  r30: 0x13313dc0  r31: 0x00cd81fc
Back to top
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11949

PostPosted: Fri Aug 22, 2003 9:17 am    Post subject:

Max,

Here's some info on the problems that you reported:

- No printing of EPS images - The reason for this is that I have not ported the EPS rendering code that is used by X11 to Java. So right now this code does nothing in NeoJ. If you send me an EPS file via e-mail (the ones I have don't have much content and are pretty useless for development and testing), I can look at implementing EPS when I get some spare time. In theory, the approach for NeoJ would be different than X11. In NeoJ, I would convert the EPS to a set of Java drawing instructions and/or JPEG images so that I can render the EPS to a Java window or printer.

- The PDF file generated by this last version hangs Preview - I could not replicate this with a simple Writer document. Could you send me a sample file via e-mail that causes the problem? My guess is that certain drawing instructions (e.g. transparency) may cause Java to render in PDF 1.3. If my assumption is correct, then it is a matter of finding which instructions do this an rewriting the code to avoid those instructions.

- One of my graphic files cause Neo/J to crash, while printing correctly in OOo/X11 - From the dump file you posted, NeoJ is crashing in the method where NeoJ allocates memory in the JVM for drawing an image. By default, on Mac OS X Java sets an upper limit of 64 MB of memory. This may not be enough in your case. To test if this is the cause, try increasing the upper limit to 256 MB by using the following steps:

1. Execute the following command to open the "setup" script:
Code:
sudo <your favorite text editor> <NeoJ installation directory>/NeoOfficeJ.app/Contents/MacOS/setup

2. Near the end of the file, there is the following line. Replace the "Applets=1" string in that line with "Applets=1\n-Xmx256m" and rerun NeoJ:
Code:
printf "[Java]\nRuntimeLib=/System/Library/Frameworks/JavaVM.framework/JavaVM\nSystemClasspath=$sysclasspath\ncom.apple.hwaccel=false\ncom.apple.hwaccellist=\nJava=1\nJavaScript=1\nApplets=1\n-Xmx256m\n\n" > "$configdir/javarc"


- I also noticed that Neo/J always prints the whole file, even if only some page is selected - This is a hack. Since Java does not collect page ranges from the user until OOo tries to print the first page, I had to let OOo think it is printing all pages and have Java, behind the scenes, not send the unselected pages to the printer. Eventually, I want to find a way to tell OOo to reset the page ranges it tries to print to speed up performance, but for now I only have this "brute force" printing method. Sad

Patrick
Back to top
Max_Barel
Oracle


Joined: May 31, 2003
Posts: 219
Location: French Alps

PostPosted: Sat Sep 13, 2003 8:41 am    Post subject: printing memory usage

I followup here, rather than by mail to avoid duplicate issues, and because it gives me an opportunity to congratulate Patrick about his amazing efficiency. As Ed and Dan for the OOo/Neo thread, you are doing a great job.
pluby (in a private mail wrote:
Is the 650 MB of memory the VSZ memory or RSS memory when you do a "ps -l -p <process number>" on the NeoJ process? RSS is the more meaningful figure as it is the actual memory used by the application for data. Usually, the RSS memory is about around 100 MB. Most of that is OOo and only about 10% - 15% is Java. However, I will have to take a look and see if something in the new print code is not getting released. A good way to test this theory is if printing works without crashing (without the -Xm256m setting in the setup scrpit) when yu first start NeoJ but crashes when printing the second or third time.

I'm not sure about this memory usage. I made a bunch of tests and it's not clear. The file causing NJ to overflow it's memory limit does not print at all without the 256m option. It does not DISPLAY either. I.e. if i try to display one of the page in the file containing 2 big images, it crash. So all my testing are WITH the 256m setup.
It seems that memory usage is increasing each time the file is printed, but this is not constant. In the 7 prints run reproduced here under, the RSS memory size stay more or less constant for the first 3 prints. Afterwhile it begins to increase by a few meg each times. On other runs I made, the size increased since the second print test.
NJ with a full screen empty window :
Code:
  UID   PID  PPID CPU PRI NI      VSZ    RSS WCHAN  STAT  TT       TIME COMMAND
  501  1216   196   0  62  0  1096596  87260 -      R     ??    0:32.86 /Volumes/Putti/Applications/NeoOfficeJ.app/Contents/MacOS/soffice.bin -psn_
with the file opened :
Code:
  UID   PID  PPID CPU PRI NI      VSZ    RSS WCHAN  STAT  TT       TIME COMMAND
  501  1216   196   0  62  0  1117716 132048 -      R     ??    0:56.74 /Volumes/Putti/Applications/NeoOfficeJ.app/Contents/MacOS/soffice.bin -psn_
after the fisrt print of the file (to a PDF file) :
Code:
  UID   PID  PPID CPU PRI NI      VSZ    RSS WCHAN  STAT  TT       TIME COMMAND
  501  1216   196   0  62  0  1131196 207876 -      R     ??    2:53.19 /Volumes/Putti/Applications/NeoOfficeJ.app/Contents/MacOS/soffice.bin -psn_
after second print :
Code:

  UID   PID  PPID CPU PRI NI      VSZ    RSS WCHAN  STAT  TT       TIME COMMAND
  501  1216   196   0  62  0  1133112 203600 -      R     ??    4:19.03 /Volumes/Putti/Applications/NeoOfficeJ.app/Contents/MacOS/soffice.bin -psn_
after third :
Code:
  UID   PID  PPID CPU PRI NI      VSZ    RSS WCHAN  STAT  TT       TIME COMMAND
  501  1216   196   0  62  0  1134756 192952 -      R     ??    5:33.82 /Volumes/Putti/Applications/NeoOfficeJ.app/Contents/MacOS/soffice.bin -psn_
after forth :
Code:
  UID   PID  PPID CPU PRI NI      VSZ    RSS WCHAN  STAT  TT       TIME COMMAND
  501  1216   196   0  62  0  1136660 218512 -      R     ??    6:51.97 /Volumes/Putti/Applications/NeoOfficeJ.app/Contents/MacOS/soffice.bin -psn_
after fifth :
Code:
  UID   PID  PPID CPU PRI NI      VSZ    RSS WCHAN  STAT  TT       TIME COMMAND
  501  1216   196   0  62  0  1138272 248524 -      R     ??    8:06.38 /Volumes/Putti/Applications/NeoOfficeJ.app/Contents/MacOS/soffice.bin -psn_
after 6th :
Code:
  UID   PID  PPID CPU PRI NI      VSZ    RSS WCHAN  STAT  TT       TIME COMMAND
  501  1216   196   0  62  0  1139932 245068 -      R     ??    9:27.30 /Volumes/Putti/Applications/NeoOfficeJ.app/Contents/MacOS/soffice.bin -psn_
after 7th :
Code:
  UID   PID  PPID CPU PRI NI      VSZ    RSS WCHAN  STAT  TT       TIME COMMAND
  501  1216   196   0  62  0  1141576 252888 -      R     ??   10:38.19 /Volumes/Putti/Applications/NeoOfficeJ.app/Contents/MacOS/soffice.bin -psn_

Is it normal? Is it Java? Is this test useful?
P.S.
Before running these tests i had two swap files (2x80 mb).
After i had nine (9) !
Back to top
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11949

PostPosted: Sat Sep 13, 2003 9:21 am    Post subject:

Max,

There is one nasty side affect of setting the Java maximum memory really high: Java can sometimes delay running its garbage collector based on the fact that it has more memory available! Hence, RSS will keep increasing.

Last night, I added explicit garbage collection whenever a window is destroyed. This seems to best approximate when a document is closed and seems a good time to clean up memory.

With this extra code in place, I can now repeatedly open and close a 241 page text document, print it, and close it and RSS stabilizes at about 115 MB. This tells me that although the initial opening and printing of a large document increases RSS, subsequent reopenings are reusing the RSS already allocated.

Now that I have the explicit garbage collection in place, I also changed the setup script to set Java maximum memory really high (-Xmx1024m) which will cause VSZ to be really high (about 1.3 GB). Although this sounds strange (and it did to me!), I talked with a friend of mine who seems to understand how operating system memory managers work. His unerstanding was that merely allocating VSZ memory doesn't actually cause the real memory to be tied up. If Mac SO X's memory manager is similar to other Unix memory managers, real memory is not tied up until the application tries to actually use the memory.

This scheme, however, only works if the application (i.e. my Java code) does not leak memory. This will be something to watch closely for in the next printtest patch that I post.

Patrick
Back to top
Display posts from previous:   
   NeoOffice Forum Index -> NeoOffice Testing All times are GMT - 7 Hours
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Powered by phpBB © 2001, 2005 phpBB Group

All logos and trademarks in this site are property of their respective owner. The comments are property of their posters, all the rest © Planamesa Inc.
NeoOffice is a registered trademark of Planamesa Inc. and may not be used without permission.
PHP-Nuke Copyright © 2005 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.