kyamagu / matlab-tcpip

TCP/IP server and client for Matlab

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Java heap space out of memory when sending/receiving

GrachiCP opened this issue · comments

When the sending or receiving information that is bigger than the available Java Heap Space you get:

java.lang.OutOfMemoryError: Java heap space

When a java method is called in Matlab, the data is copied to the java heap space. This is a limitation when data is too big.

Maybe changing the implementation of Input/OutputStream read/write to a buffered version to avoid this problem.

@GrachiCP Thanks for reporting this. Will check the buffered alternative (or pull-request me).

@GrachiCP The latest commit should resolve the out-of-memory issue. It was a bit tricky to workaround Matlab's automatic byte conversion.