When readObject() encounters primitive types (int, char, etc) instead of an
object instance in the input stream, this type of exception will be thrown.
This error is thrown when a request is made for more memory either as a
result of the running program, or because of the internal behavior of the
virtual machine which can not be satisfied using the available platform
resources.