1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

What is Java using all that RAM for?

Discussion in 'Enhanced Search Support' started by Big Dan, Nov 9, 2013.

  1. Big Dan

    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.PNG

    Code:
     free -m
                 total       used       free     shared    buffers     cached
    Mem:          1869       1802         66          0        111        534
    -/+ buffers/cache:       1157        712
    Swap:          511         44        467
    
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    Big Dan likes this.
  3. Big Dan

    Big Dan Active Member

  4. MattW

    MattW Well-Known Member

    What did you allocate in the ES config?
     
  5. MattW

    MattW Well-Known Member

    Also, you have
    -/+ buffers/cache: 1157 712

    That's 712MB of actual RAM free on the VPS, so it shouldn't be swapping with that.
     
    Big Dan likes this.
  6. Big Dan

    Big Dan Active Member

    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`.
    
     
  7. Big Dan

    Big Dan Active Member

    I'm not very familiar with how to read that - Why is it telling my I only have 66 free then in the line above.
     
  8. MattW

    MattW Well-Known Member

    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
     
    Big Dan likes this.
  9. Big Dan

    Big Dan Active Member

    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?
     
  10. MattW

    MattW Well-Known Member

    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.
     
    Big Dan likes this.
  11. Luke F

    Luke F Well-Known Member

    Unless configured otherwise, linux will swap underused/leaked pages way before it runs out of physical ram
     

Share This Page