Java.lang.OutOfMemoryError: a bunch of Java heaps when using this short program to remove a title bar

I found this code snippet in stackoverflow to display fullscreen color in MATLAB: Remove title bar from MATLAB GUI for fullscreen display

The problem is that as soon as I run the program 5 times, an error message appears:

??? Java exception: java.lang.OutOfMemoryError: heap Java space ".

Now I could increase the heap of space as described here

But since my application has to work for long periods of time, is there a way I can clear the heap every time I run the script? That way, I won’t need to allocate more memory and eventually it will end.

+4
source share
1 answer

Well, you can always just make "clear java" if you don't mind to blow away everything.

+1
source

Source: https://habr.com/ru/post/1386001/


All Articles