JMeter - out of memory on linux

前端 未结 2 1834
离开以前
离开以前 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: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.

提交回复
热议问题