| Author |
Is serialization implementation may cause inadequate heap size memory?
|
Birla Murugesan
Ranch Hand
Joined: Nov 25, 2008
Posts: 66
|
|
Is serialization implementation may cause inadequate heap size memory?
Is it possible?
|
 |
Sagar Rohankar
Ranch Hand
Joined: Feb 19, 2008
Posts: 2896
|
|
|
Serialization is simply, storing and retrieving the objects and it should not cause the inadequate heap size, especially during deserialization of objects. Leave everything else to the GC.
|
[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
|
 |
Birla Murugesan
Ranch Hand
Joined: Nov 25, 2008
Posts: 66
|
|
Sagar Rohankar wrote:Serialization is simply, storing and retrieving the objects and it should not cause the inadequate heap size, especially during deserialization of objects. Leave everything else to the GC.
see,serialization is the process which do the object caching,so if the cached object not go for deserialization for a long time which might lead to inadequate heap size
|
 |
Sagar Rohankar
Ranch Hand
Joined: Feb 19, 2008
Posts: 2896
|
|
Birla Murugesan wrote:
Sagar Rohankar wrote:Serialization is simply, storing and retrieving the objects and it should not cause the inadequate heap size, especially during deserialization of objects. Leave everything else to the GC.
see,serialization is the process which do the object caching
But "caching space" is not necessarily be the heap space, because when you want to serialize your objects to the output stream then one might uses file or sockets to flattened the objects, no one uses JVM memory to serialize objects, that's not Serialization concept is used for.
May be reading this article helps you to understand most of the things !
|
 |
Ernest Friedman-Hill
author and iconoclast
Marshal
Joined: Jul 08, 2003
Posts: 24061
|
|
An ObjectOutputStream needs a cache of every object you write to it, so that if you write the same object again, it can substitute a reference to the earlier object, rather than writing a new copy. You'd think that ObjectOutputStream would use WeakReferences in that table, but it does not. Therefore, if you keep an ObjectOutputStream open for a long time, it can be a source of memory leaks, since objects that would otherwise be garbage collected can be retained because of the reference in that cache.
So yes, serialization can cause you to run out of memory, but not for any of the reasons previously discussed in this thread.
|
[Jess in Action][AskingGoodQuestions]
|
 |
Birla Murugesan
Ranch Hand
Joined: Nov 25, 2008
Posts: 66
|
|
Hi friends,
Thanks for the help in my clarification
|
 |
 |
|
|
subject: Is serialization implementation may cause inadequate heap size memory?
|
|
|