This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes I/O and Streams and the fly likes Huge number of int arrays during deserialization. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "Huge number of int arrays during deserialization." Watch "Huge number of int arrays during deserialization." New topic

Huge number of int arrays during deserialization.

Raja Reddy Karri

Joined: Nov 29, 2013
Posts: 1
We see that there are huge number of int array instances during deserialization. We understand that this is due to creation of dependency tracking objects ($HandleTable$HandleList) created. As I understand, they are used to propagate ClassNotFoundException to "dependent" objects while reading an object.

I fail to understand the need to track this dependency of ClassNotFoundException over a target object? Why can't the implementation throw the exception right away, if the ClassNotFoundException is found?

Going through the code of ObjectInputStream, I think any ClassNotFoundException could be propagated immediately, rather marking the exception on every dependent object, thus avoiding HandleList and int[].

I do realize that HandleTable's "entries" are absolutely required to wire any previously read objects into dependent objects read later from the stream. Just to clarify, question is about significance of$HandleTable$HandleList, which I fail to understand.

Any insight is greatly appreciated.

I agree. Here's the link:
subject: Huge number of int arrays during deserialization.
It's not a secret anymore!