I do not know why Java Serialization was voted, it is a completely viable mechanism.
This is not clear from the original message, but still 2G of data on the heap at the same time? Or are you dumping something else?
"" , Externalizable , . - , . Externalizable, , , .
- , . , , , , . ObjectStream / Java.
, ObjectOutputStream.writeObject(yourBigDatastructure) , Externalizable.
writeObject .
"objectToFile", , . , Externalizable, .
, , .. , .