[英]Could not reserve enough space for object heap
I'm writing a wrapper to Lucene. 我正在为Lucene写一个包装器。 When a search request is made frequently, it's possible "Could not reserve enough space for object heap" will be thrown.
当频繁发出搜索请求时,可能会抛出“无法为对象堆保留足够的空间”。 How can I get the size of the object heap?
如何获得对象堆的大小? And how can I solve that?
我该如何解决?
I believe that the underlying problem is the same as is described in the good answers to the SO question Could not reserve enough space for object heap . 我认为潜在的问题与SO问题的良好答案中描述的相同无法为对象堆保留足够的空间 。
That is, the JVM is attempting to ask the OS for memory for the heap, and the OS is refusing because it has already allocated all virtual memory to other processes. 也就是说,JVM正在尝试向操作系统询问堆的内存,并且操作系统正在拒绝,因为它已经将所有虚拟内存分配给其他进程。
I expect that this happens when you launch the indexer frequently because: 我希望您经常启动索引器时会发生这种情况,因为:
Of course, this is largely conjecture ... 当然,这主要是猜想......
What can you do about it? 你能为这个做什么?
Some of these need to be done with care, because they could impact on overall system performance in various ways. 其中一些需要谨慎完成,因为它们可能以各种方式影响整体系统性能。
(Incidentally, I don't think that switching to a 64 bit OS will necessarily help, and running a 64 bit JVM certainly won't help ...) (顺便说一句,我不认为切换到64位操作系统必然帮助,并运行64位JVM肯定不会帮...)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.