Oliver, it will get cleaned up when the VM needs the memory. Provided, of course, that you drop the element. One thing I may suggest is a local filesystem cache so you don't have to store these huge objects in memory for the lifetime of the session. The session is a long-lived object. Even closing the browser, the session will typically hang around for an hour or more and not allow the vm to perform a garbage collection because the session may not be closed. If you store an reference to the file in a disk cache and implement a Session binding listener, you could delete the file when the session goes away, but in the mean time only a small amount of your memory is actually taken up by this file.

Scott

Pfau, Oliver wrote:
I set the object from a portlet and open the PDF byte[] in a non-portlet jsp. The only way it worked by now was to set the object in portlet application scope and read it in the jsp with session.getAttribute(...)

------------------------------------------------------------------------
*Von:* [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
*Gesendet:* Montag, 14. Mai 2007 17:45
*An:* MyFaces Discussion
*Betreff:* Re: JSF, Tomcat memory usage


Why are you storing such a large object in session scope in the first place? What's wrong with a different scope?




*"Andrew Robinson" <[EMAIL PROTECTED]>*

05/14/2007 10:52 AM
Please respond to
"MyFaces Discussion" <users@myfaces.apache.org>


        
To
        "MyFaces Discussion" <users@myfaces.apache.org>
cc
        
Subject
        Re: JSF, Tomcat memory usage



        





The memory will not go away until the GC decides to clean up the
objects. You may want to try to force a GC for testing reasons and see
if that shows that it is working fine (then you can remove the call to
GC as you should never call it directly)

On 5/14/07, Pfau, Oliver <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have made some test with my JSF portlet regarding memory consumption
> with liferay and tomcat. The memory usage increases up to 1,1 Gbyte.
> After closing the session and waiting, the memory usage does not
> decrease.
> In detail I store a big PDF as byte[] in the session, show it and remove
> it from the session but the memory usage remains on the highest value.
> That's strange I think.
>
>


_________________________

CONFIDENTIALITY NOTICE

The information contained in this e-mail message is intended only for the exclusive use of the individual or entity named above and may contain information that is privileged, confidential or exempt from disclosure under applicable law. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivery of the message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify the sender immediately by e-mail and delete the material from any computer. Thank you.

Reply via email to