What is Java using all that RAM for?

Big Dan

Active member
Before installing elastic search and Java, my forum was running fine on a VPS with 1 GB RAM. Today, I noticed RAM utilization was around 90% so I had my host double the RAM. I'm now running 2 GB of RAM and Java is still eating up 50% of RAM and I'm swapping. What gives? There is no way this site needs anywhere near 2GB of RAM to run.

java.webp

Code:
 free -m
             total       used       free     shared    buffers     cached
Mem:          1869       1802         66          0        111        534
-/+ buffers/cache:       1157        712
Swap:          511         44        467
 
What did you allocate in the ES config?
I didn't do the install myself. I hired it out. Is /elasticsearch/config/elasticsearch.yml the proper file? If so everything reguarding memory is commented out.

Code:
################################### Memory ####################################

# ElasticSearch performs poorly when JVM starts swapping: you should ensure that
# it _never_ swaps.
#
# Set this property to true to lock the memory:
#
# bootstrap.mlockall: true

# Make sure that the ES_MIN_MEM and ES_MAX_MEM environment variables are set
# to the same value, and that the machine has enough memory to allocate
# for ElasticSearch, leaving enough memory for the operating system itself.
#
# You should also make sure that the ElasticSearch process is allowed to lock
# the memory, eg. by using `ulimit -l unlimited`.
 
free -m will tell you how much ram is being used. The first thing with Linux is that it will use as much ram as possible, but you have things cached. You have 712MB free to use by other applications is required.

http://www.linuxatemyram.com/

This is the file where you set how much ram to use

/elasticsearch/bin/service/elasticsearch.conf
 
free -m will tell you how much ram is being used. The first thing with Linux is that it will use as much ram as possible, but you have things cached. You have 712MB free to use by other applications is required.

http://www.linuxatemyram.com/

This is the file where you set how much ram to use

/elasticsearch/bin/service/elasticsearch.conf
Thanks Matt. I ran Ubuntu on my desktop for quite a while and never realized how Linux handled RAM. Neat site BTW. :)

set.default.ES_HEAP_SIZE=1024 is waht's there - I guess that's 1GB which is more than enough - is it wise to lower it or just leave it alone?
 
I've lowered mine down to 256MB based on 250,000 posts, which with the figures previously mentioned by @Slavik should be good to 500,000 now with the new mapping.

You'd be fine lowering it down to 512mb and restarting ElasticSearch.
 
Top Bottom