Relates :
|
The size of the internal arrays of java.io.ObjectInputStream, and java.io.ObjectOutputStream gets doubled every time, when the size is no longer sufficient. While this may work fine for smaller arrays, it gets very costly for larger sizes: e.g.: assume current capacity is 512mb; if space for 512m+1 bytes is needed, it will grow the size of the internal arrays to the size of 1g in one single step.