I’m writing a wrapper to 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?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.
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.
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 …)