Java exception occurred: java.lang.OutOfMemoryError: Java heap space
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
After running for several hours, the matlab stopped running and displayed like below:
Error using icinterface/flushinput (line 42)
Java exception occurred:
java.lang.OutOfMemoryError: Java heap space
at
com.mathworks.toolbox.instrument.LineInputStream.readByte(LineInputStream.java:59)
at
com.mathworks.toolbox.instrument.LineInputStream.flush(LineInputStream.java:47)
at
com.mathworks.toolbox.instrument.SerialComm.hardwareFlushInput(SerialComm.java:644)
at
com.mathworks.toolbox.instrument.InstrumentReader.flushinput(InstrumentReader.java:154)
Error in GUI_Aging_of_capacitor>testCAP (line 575)
flushinput(serialport_LCR);
Error in GUI_Aging_of_capacitor>START_Callback (line 430)
testCAP(LCR,0,handles);
Error in gui_mainfcn (line 95)
feval(varargin{:});
Error in GUI_Aging_of_capacitor (line 42)
gui_mainfcn(gui_State, varargin{:});
Error in
matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)GUI_Aging_of_capacitor('START_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating UIControl Callback.
Thanks in advance for your help!!!
0 commentaires
Réponses (1)
Walter Roberson
le 3 Oct 2017
Looking around a bit, it appears to me that the Java class being used, LineInputStream, is for CR/LF delimited streams. The flush method is probably handled by reading the line and discarding that until there is no more current input. That would be a problem if you happened to hit upon a block of bytes that had no CR/LF in it: it appears it might possibly try to keep reading.
2 commentaires
Walter Roberson
le 4 Oct 2017
If I am correct about the cause, then if for some reason a sufficiently large block with no CR/LF was present in the input stream, it would overfill any memory you might allocate. But perhaps it would be "good enough" for your purpose.
I cannot tell from what you posted what kind of device you are talking to (other than serial), or why you are talking to it. My speculation would be that you are doing a data transfer of some sort and you are losing synchronization.
What are the circumstances under which your program makes the flushinput() request?
Voir également
Catégories
En savoir plus sur Java Package Integration dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!