0

While using lucene for full text search, i want to keep the index in memory.I read that the index size can be maximum of size 2GB and if it exceeds, we will get OutOfMemoryException. Will using multisearcher serves as a solution to it?In multiSearcher also we create multiple indexes,isnt it?

user3701803
  • 93
  • 1
  • 10

1 Answers1

0

I don't believe there is a hard limit on RAM index size, other than the space alloted to the JVM. Combining indexes with a MultiReader won't help you overcome not having enough memory available to the JVM (unless you are planning to build, and subsequently trash, indexes as needed, or something like that, but I'm guessing that is not the case).

See this question: Increase heap size in java, for how to give it more space.

Also, Mike McCandless wrote a blog post on this topic that might be of interest to you.

Community
  • 1
  • 1
femtoRgon
  • 32,893
  • 7
  • 60
  • 87
  • can you clarify https://stackoverflow.com/questions/8391575/how-to-use-ramdirectory-and-avoid-outofmemoryexception-if-the-object-size-exceed – user3701803 Nov 20 '14 at 04:50
  • do you mean to say that the index size depends on the space alloted to jvm?so, if my index size exceeds the memory available to jvm, it gives me OutOfMemoryException? – user3701803 Nov 20 '14 at 04:51
  • Well, yeah. You're storing it in RAM, so if it's larger than the amount of RAM available, it won't work so well. The question you are referring to is discussing Lucene.net. Limitations imposed in .Net don't apply to java. – femtoRgon Nov 20 '14 at 06:11