Phil,

Thank you for your answer. I really appreciate it.
It helped.

On Wed, 25 Sep 2002 12:08:32 -0700, Phil Race <[EMAIL PROTECTED]> wrote:

>> I'm getting "Out Of Memory".
>
>Assuming your TIFF image is representing a binary image then the current
>printing implementation is inefficient. If you get OutofMemory errors and
>can't increase the memory available to the VM (because you are an applet)
>then you will need to print the image as tiles.

You are right. Those images are binary.
I was misled by this article:
http://swjscmail1.java.sun.com/cgi-bin/wa?A2=ind0104&L=jai-interest&F=&S=&P=21384

I thought that drawRenderedImage method actually uses tiles. But as this fact shows, 
it does not.

>> PrinterJob produces 70-300KB tasks.
>
>do you mean spool files? That doesn't sound too bad.

When I changed the code and now it does not eats that much memory.
Though, it produces 1-1.5MB spool files.

>> Each task eats about 1M from the heap. This memory could not be returned back
>even through calling the garbage collector. Is that a known bug of AWT? Why it
>consumes so much memory when printing?
>> Is there a workaround for this problem?
>
>Whether Java heap memory is returned to the O/S is a function of the VM.
>It has nothing to do with AWT/2D and is no more under AWT/2D's control than
>it is under yours.

I was talking about JVM heap, not about OS. GC did not release memory (return to the 
JVM heap) even when printing was finished. That's why I concerned.

Thank you,
Alexander Glazkov

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to