[英]How can I correct a “Java heap space - Out of Memory” error
I'm currently running my system against a rather large dataset and am getting the error.我目前正在针对相当大的数据集运行我的系统,但出现错误。 'Out of memory. '内存不足。 Java Heap Space'. Java堆空间'。
Is there anyway to get around this or is it just a case of the dataset is too large and can't be used?有没有办法解决这个问题,还是只是数据集太大而无法使用的情况?
In general, you can either一般来说,你可以
If it's not the dataset that's eating up memory, it could be that you are not freeing up objects once they are inactive.如果不是数据集占用了内存,则可能是因为您没有在对象处于非活动状态时释放它们。
This is typically due to keeping references to very large objects or to lots objects laying around long after they are no longer needed.这通常是由于保留对非常大的对象的引用,或者在不再需要它们之后很长一段时间内仍然存在大量对象。 This is most likely references that are static variables, but it can also be references to large temporary variables (eg, large StringBuilder
objects) within methods that are still active.这很可能是静态变量的引用,但它也可能是对仍处于活动状态的方法中的大型临时变量(例如,大型StringBuilder
对象)的引用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.