This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | exporting diagram containing 50+ classes to jpg results in zero file size | ||
---|---|---|---|
Product: | uml | Reporter: | Peter Lam <petersl> |
Component: | Output | Assignee: | Viktor Lapitski <lvv> |
Status: | VERIFIED FIXED | ||
Severity: | blocker | ||
Priority: | P2 | ||
Version: | 5.x | ||
Hardware: | All | ||
OS: | Windows XP | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: |
experiment class diagram
experiment class diagram - png format experiment class diagram - svg format |
Description
Peter Lam
2007-01-06 00:58:34 UTC
Created attachment 37101 [details]
experiment class diagram
Created attachment 37102 [details]
experiment class diagram - png format
Created attachment 37103 [details]
experiment class diagram - svg format
Attached are the diagrams in jpg, png, svg format exported for the experiment with the diagram containing 110 elements. Png encoder performance was taken care of by fix to 91260. The remaining part of the bug is when generated image file size is 0 (for the reasons different from java.lang.ClassCastException: sun.awt.image.DataBufferNative mentioned in 82934) This failure to generated an image happens when size of the original image to be encoded causes request for the amount of memory that exceeds memory availaible inside the VM instance. It happens because the 3d party graph library used inside the UML module atempts to render whole image in memory before encoding it. In particular it means that 7000 pixels x 7000 pixels image would cause a request for an int[50M] buffer, ie. 200M piece of heap memory. The maximum possible image is more than 50Mpixels, yet even with Xmx1280 i wasn't always able to save 100Mpixels image. Thus, in order to fix this bug, as we can't change the behaviour of the library, i plan to implement an error dialog for this situation explicitly informing the user that the operation failed. Fixed in release55 branch. Now when user tries to save as png/jpg/... a diagram with such resolution that JVM can't provide TS with an array to render the image into [ because of not sufficient heap memory available or because the requested array is beyond the Java array size limit - that happens pretty easy - 50Kpxls X 50Kpxls = 2.5Gpxs, where is Java array limit is (2^31 - 1) and even 0.5Gpxls would be a problem for 32bit JVM as each pixels requires an "int" ] the error dialog is shown informing the user about the error. verified in build 070213_1. Now the error dialog pops up. The dialog has title "Cannot create image" and the message is "Java Heap space". The message should have been more informative. The message comes from the exception that was caught. This minimalistic approach was modeled after similar error dialog that pops up when, for example, the file that image should be saved into isn't writtable. I suppose the documentation may be the place where the error messages and possible remedies/workarounds can be explained. issue 96194 was opened to track the need to improve the message in the dialog box as a result of the fix to this issue. |