Question :Why is OutOfMemoryError thrown after writing a large number of objects
into an ObjectOutputStream? (CoreJava)
Answer :The ObjectOutputStream maintains a table mapping objects written into
the stream to a handle. The first time an object is written to a stream, its
contents are written into the stream; subsequent writes of the object result
in a handle to the object being written into the stream. This table
maintains references to objects that might otherwise be unreachable by an
application, thus, resulting in an unexpected situation of running out of
memory. A call to the ObjectOutputStream.reset() method resets the
object/handle table to its initial state, allowing all previously written
objects to be elgible for garbage collection.
www.interviewhelper.org is a hope for all the Job seekers. Users can find unlimited here. These range from technical to HR, from functional to behavioral. www.interviewhelper.org contains in the fields like Ajax,VB,Networking,Sharepoint,JEE,Perl,Javascript,Bioinformatics,Classic ASP,Unix,Linux,Accounting,Oracle DBA,Microprocessor,Bluetooth,jms,jme,.net framework,ABAP,ASP,ASP.net,Basic .net Framework,Interview Questions,C language,C++,database,Oracle,Java,PHP,LAMP,SAP etc.
Thursday, March 12, 2009
Why is OutOfMemoryError thrown after writing a large number of objects
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment