Common java. lang. OutOfMemoryError: unabletocreatenewnativethread Solution

Source: Internet
Author: User

Common java. lang. OutOfMemoryError: unabletocreatenewnativethread Solution

A Brief Introduction to the solutions to similar problems

I encountered this problem when I ran a pressure test on a machine for xxx users. I couldn't even enter xxx.

It indicates that xxx users cannot create multiple threads (of course, the root user does not have this problem)

Maximum Number of threads that the system can create: (MaxProcessMemory-JVMMemory-system memory)/(ThreadStackSize) = Number of threads

There are two methods:

Reduce ThreadStackSize under xxx

Increase the number of nproc under xxx

Modify

[Lsmpusr @ wxlab28bin] $ ulimit-

Core filesize (blocks,-c) 0

Data segsize (kbytes,-d) unlimited

Schedulingpriority (-e) 0

Filesize (blocks,-f) unlimited

Pendingsignals (-I) 256636

Max lockedmemory (kbytes,-l) 64

Max memorysize (kbytes,-m) unlimited

Openfile (-n) 65536

Pipesize (512 bytes,-p) 8

POSIX messagequeues (bytes,-q) 819200

Real-timepriority (-r) 0

Stacksize (kbytes,-s) 10240 ----- reduces this value. We recommend that you reduce it in jvm-xss.

Cputime (seconds,-t) unlimited

Max userprocesses (-u) 1024 ----- You can increase this to 32000

Virtualmemory (kbytes,-v) unlimited

Filelocks (-x) unlimited

Modify/etc/security/limits. conf

* Soft nofile 65536
* Hard nofile 65536
Xxx soft nproc 32000
Xxx hard nproc 32000
Xxx soft stacks 1024
Xxx hard stack 1024

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.