java.lang.OutOfMemoryError:使用这个短程序删除标题栏时的Java堆空间
我在 stackoverflow 上找到了这段代码,用于在 MATLAB 中显示全屏颜色: 从 MATLAB GUI 中删除标题栏以实现全屏显示
问题是,一旦我运行该程序 5 次,就会出现错误:
???发生Java异常:java.lang.OutOfMemoryError:Java堆 出现“空格”错误。
现在,我可以像描述的那样增加堆空间 这里
但是由于我的应用程序必须运行很长一段时间,有没有办法可以在每次运行脚本时清除堆空间? 这样,我就不必分配更多的堆空间内存并最终耗尽它。
I found this piece of code on stackoverflow for displaying a fullscreen colour in MATLAB:
Remove titlebar from MATLAB GUI for full screen display
The problem is that once I've run the program 5 times, there is an error that shows up:
??? Java exception occurred: java.lang.OutOfMemoryError: Java heap
space" error that shows up.
Now, I could increase heap space like it is described here
But since my application has to run for long periods of time, is there a way I can clear the heapspace each time the script is run?
In this way, I won't have to allocate more heapspace memory and have that run out eventually as well.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,如果你不介意把所有东西都吹走的话,你总是可以做一个“clear java”。
Well, you could always just do a "clear java" if you don't mind blowing away everything.