On 1/31/2018 1:54 PM, TK Solr wrote:
On my AWS t2.micro instance, which only has 1 GB memory, I installed Solr (4.7.1 - please don't ask) and tried to run it in sample directory as java -jar start.jar. It exited shortly due to lack of memory.

How much memory does Solr require to run, with empty core?

If you use the literal commandline "java -jar start.jar" then Java is going to decide how much memory it wants to allocate.  It could end up deciding to use a value that your specific OS installation can't actually support.  Solr can't do anything to change this. You can reduce the amount of heap that Java tries to allocate with the -Xmx option -- perhaps "java -Xmx512m -jar start.jar" would be a good starting point.

Solr versions since 4.10 have a startup script that sets many things that you don't get when running java directly yourself. The startup script is greatly improved in 5.0, and has steadily gotten better since then.

On a Windows 7 system, I have a download of Solr 7.0.0, with one core created using the default configset.  The core is empty and has an index size of 72 bytes.

With this commandline (telling Java to use a 16MB max heap), everything I did works:

bin\solr start -m 16m

I did not try indexing.  It is likely that indexing would not work with a 16MB heap, because I think the example configset would try to allocate a 100MB indexing buffer, and would probably need additional memory beyond that.  Indexing tends to increase heap requirements, especially heavy indexing.

With this commandline, I got out of memory errors just by navigating around the admin UI:

bin\solr start -m 12m

Even though I could get Solr working with a 16MB heap, I think I would not try running it "for real" with a heap less than the 512MB default that the script chooses by default.  On a machine with 1GB of memory, if Solr is the only software it has beyond the OS, a 512MB heap would probably work, as long as the OS was something like Linux, which is fairly lightweight when there is no GUI.  If the OS has a GUI, 1GB is probably not enough memory for a 512MB heap.

Once the index begins to achieve any size, most users end up needing to increase the heap beyond 512MB, and the machine will need more than 1GB.

The script that I used to start version 7 is not available in version 4.7.1.  The older version probably has lower memory requirements than the newer one, but it would not be *significantly* lower.

Thanks,
Shawn

Reply via email to