JMeter - out of memory on linux

前端 未结 2 1831
离开以前
离开以前 2021-02-09 06:53

I am trying to run a load test for a application. For this i am using JMeter (v.2.13) on an Ubuntu Vm with 60GB Ram and more than enough CPU power. Goal is to reach 10k Users co

相关标签:
2条回答
  • 2021-02-09 07:14

    First of all check if you can allocate as much as 50G heap by the following command:

    java -Xms50G -version
    

    If it doesn't succeed - try reducing minimum heap size unless you see your Java version information without errors.

    As long as you're NOT getting java.lang.OutOfMemoryError: Java heap space error I believe that your heap size tunings are successfully applied.

    Perhaps you have a memory-intensive listener enabled, like View Results Tree or View Results in Table? If so - disable them (as well as any other listeners)

    If possible try switching to Oracle JDK as at least for Java 6 there were immense performance differences.

    Also make sure that you following recommendations from JMeter Performance and Tuning Tips guide.

    0 讨论(0)
  • 2021-02-09 07:28

    Okay meanwhile i figured it out:

    1. make sure to read Dmriti T's post
    2. set the java's stacksize to something small - usually the smallest value will be enough. In my case 200k (see also point 4.)
    3. increase the maximum number of open files in the sysctl.conf (see point 4)
    4. increase heap size - but as jmeter will create a lot of threads also leave enough space for the memory the threads will need on OS level (so a new thread needs memory on OS and java heap - therefore leave the os enough memory too) (see below)
    5. update the limits.conf (see below)
    6. update the sysctl.conf-file (see below)

    limits.conf

    /etc/security/limits.conf

    *         hard    nofile      900000
    *         soft    nofile      900000
    root      hard    nofile      900000
    root      soft    nofile      900000
    

    sysctl.conf

    /etc/sysctl.conf

    kernel.pid_max=999999
    kernel.thread-max=999999
    vm.max_map_count=999999
    fs.file-max=999999
    

    attention: is pid_max and thread-max

    jmeter.sh / jmeter.bat

    you will find those in the /bin/ folder of your jmeter installation.

    under linux add the line

    JVM_ARGS="-Xmx15g -Xss250k"
    

    somewhere before the actual java call on the last line. This will decrease the stacksize allocated for each thread.

    under windows you have to edit the jmeter.bat. I have no configured it under windows but at least regarding the heap there should be a line starting with set HEAP. I dont know where to put the -Xss parameter under windows.

    0 讨论(0)
提交回复
热议问题