tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shapira, Yoav" <Yoav.Shap...@mpi.com>
Subject RE: Antwort: [OFF-TOPIC] ObjectOutputStream keeping handles
Date Mon, 19 Jan 2004 16:25:39 GMT

Howdy,
Reset() is slow as you mentioned.  But writeUnshared instead of
writeObject solves the problem for us as our serialized objects are
independent.  Thanks,

Yoav Shapira
Millennium ChemInformatics


>-----Original Message-----
>From: Bruno.Melloni@nokia.com [mailto:Bruno.Melloni@nokia.com]
>Sent: Monday, January 19, 2004 9:00 AM
>To: tomcat-user@jakarta.apache.org
>Subject: RE: Antwort: [OFF-TOPIC] ObjectOutputStream keeping handles
>
>I encountered this problem 3-4 years ago.  According to Sun this is by
>design.  ObjectOutputStream keeps the handles of all objects until you
>execute a reset() or close the stream.
>
>Unfortunately, if you don't do one of these things you end up with a
memory
>leak because the objects are never garbage collected.  Also, our
testing
>back then showed that resetting the output stream each time is slow.  I
>think we settled for a reset every 100 objects.  Just in case, you
might
>want to also check to make sure that the reset() does not make you
loose
>objects before you get them through the input stream.  This was not an
>issue for us (we were streaming snapshots from a camera and had no
visible
>effect), so we never checked to see if it was a problem.
>
>The last time I looked, they had slightly improved the documentation so
>that it at least gave some "clue" that this was happening, but they had
not
>yet made it 100% obvious.
>
>-----Original Message-----
>From: ext Ulrich.Kleeberger@witt-weiden.de
>[mailto:Ulrich.Kleeberger@witt-weiden.de]
>Sent: Monday, January 19, 2004 6:55 AM
>To: Tomcat Users List
>Subject: Antwort: [OFF-TOPIC] ObjectOutputStream keeping handles
>
>
>
>hi yoav,
>
>have you tried java.io.ObjectOutputStream.reset()?
>
>uli
>
>
>
>
>
>                      "Shapira, Yoav"
>                      <Yoav.Shapira@mpi        An:       "Tomcat Users
>List" <tomcat-user@jakarta.apache.org>
>                      .com>                    Kopie:
>                                               Thema:    [OFF-TOPIC]
>ObjectOutputStream keeping handles
>                      16.01.04 18:01
>                      Bitte antworten
>                      an "Tomcat Users
>                      List"
>
>
>
>
>
>
>
>Howdy,
>Has anyone bumped into an issue where java.io.ObjectOutputStream keep
>references to serialized objects until the stream is closed, thereby
>preventing the objects from being garbage-collected?  I know I can get
>around this by closing and reopening the stream after every write, but
>that seems to be a high-overhead approach.  Any other ideas?
>writeUnshared() perhaps?
>
>Yoav Shapira
>Millennium ChemInformatics
>
>
>
>
>
>This e-mail, including any attachments, is a confidential business
>communication, and may contain information that is confidential,
>proprietary and/or privileged.  This e-mail is intended only for the
>individual(s) to whom it is addressed, and may not be saved, copied,
>printed, disclosed or used by anyone else.  If you are not the(an)
intended
>recipient, please immediately delete this e-mail from your computer
system
>and notify the sender.  Thank you.
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org




This e-mail, including any attachments, is a confidential business communication, and may
contain information that is confidential, proprietary and/or privileged.  This e-mail is intended
only for the individual(s) to whom it is addressed, and may not be saved, copied, printed,
disclosed or used by anyone else.  If you are not the(an) intended recipient, please immediately
delete this e-mail from your computer system and notify the sender.  Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message