JMeter - sin memoria en Linux

Estoy tratando de ejecutar una prueba de carga para una aplicación. Para esto estoy usando JMeter (v.2.13) en un Ubuntu Vm con 60 GB de RAM y más que suficiente potencia de CPU. El objetivo es llegar a 10k usuarios conectados a través de WebSocket.

Sin embargo, durante las ejecuciones de prueba, obtengo los siguientes errores en la consola ssh (con usuarios simulados de aproximadamente 1.5k a 2.5k)

OpenJDK 64-Bit Server VM warning: Attempt to protect stack guard pages failed.
OpenJDK 64-Bit Server VM warning: Attempt to deallocate stack guard pages failed.
OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00007f20ee653000, 12288, 0) failed; error='Cannot allocate memory' (errno=12)
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (malloc) failed to allocate 12288 bytes for committing reserved memory.
# An error report file with more information is saved as:
# /jmetertests/jm/bin/hs_err_pid1833.log
OpenJDK 64-Bit Server VM warning: Attempt to deallocate stack guard pages failed.
OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00007f2218de8000, 12288, 0) failed; error='Cannot allocate memory' (errno=12)

El archivo de informe de error mencionado se ve así

# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (malloc) failed to allocate 12288 bytes for committing reserved memory.
# Possible reasons:
#   The system is out of physical RAM or swap space
#   In 32 bit mode, the process size limit was hit
# Possible solutions:
#   Reduce memory load on the system
#   Increase physical memory or swap space
#   Check if swap backing store is full
#   Use 64 bit Java on a 64 bit OS
#   Decrease Java heap size (-Xmx/-Xms)
#   Decrease number of Java threads
#   Decrease Java thread stack sizes (-Xss)
#   Set larger code cache with -XX:ReservedCodeCacheSize=
# This output file may be truncated or incomplete.
#
#  Out of Memory Error (os_linux.cpp:2798), pid=1833, tid=140472285792000
#
# JRE version: OpenJDK Runtime Environment (7.0_75-b13) (build 1.7.0_75-b13)
# Java VM: OpenJDK 64-Bit Server VM (24.75-b04 mixed mode linux-amd64 )
# Derivative: IcedTea 2.5.4
# Distribution: Ubuntu 14.04 LTS, package 7u75-2.5.4-1~trusty1
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again

Traté de asignar más memoria modificando jmeter.sh agregando la siguiente línea justo antes de que se emita el comando java en el archivo .sh:

JVM_ARGS="-Xms5g -Xmx20g -Xss300k"

También intenté configurar el_JAVA_OPTIONS variable de entorno con el siguiente comando

export _JAVA_OPTIONS="-Xms5g -Xmx20g"

Y finalmente encontré este comando con un SO-thread

sysctl -w vm.max_map_count=500000

lostop-Command me da la siguiente información sobre la memoria

KiB Mem:  61836576 total, 15163400 used, 46673176 free,    10636 buffers
KiB Swap:        0 total,        0 used,        0 free.    94492 cached Mem
ACTUALIZAR

FYI: No uso ningún oyente en JMeter excepto el simple escritor de datos. Sin embargo, se producen errores incluso si desactivo ese último oyente.

java -Xms40g -version

es exitoso, así que realmente puedo asignar tanta memoria

Reduje el tamaño de la pila usando

-Xss300k

lo que ayudó al menos a cambiar algo ya que ahora obtengo un

Uncaught Exception java.lang.OutOfMemoryError:
unable to create new native thread. See log file for details.

error. Parece que la cantidad de subprocesos en el sistema están agotados?

Actualización2

según lo solicitado por algún usuario los resultados ufulimit -a

core file size          (blocks, -c) 0
scheduling priority             (-e) 0
pending signals                 (-i) 491456
max locked memory       (kbytes, -l) 64
open files                      (-n) 500000
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 8192
max user processes              (-u) 491456
... all other entries are set to 'unlimited'

y the limit.conf contiene las siguientes entradas

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

Además, he configurado elthreads-max debajoproc/sys/kernel a algo ridículamente alto y también aumentó el valor deproc/sys/vm/max_map_count

¿Me perdí algo o hice algo mal? Gracias por tu ayuda.

Respuestas a la pregunta(2)

Su respuesta a la pregunta