glassfish:Resource temporarily unavailable in tsStartJavaThread

Today the test server (using glassfish3.1.1) suddenly reported the following exception while deploying the application. -bash: fork: retry: Resource permanently unavailable. If you have no further questions, then you have no further questions.

[ERROR] [ERROR][thread ] Could not start thread Keep-Alive-Timer. Resource temporarily unavailable
[ERROR] Exception in thread "Main Thread" java.lang.OutOfMemoryError: Resource temporarily unavailable in tsStartJavaThread (lifecycle.c:1096).
[ERROR] Java heap 3G reserved, 64M committed
[ERROR] Paged memory=18014398505034060K/18389412K.
[ERROR] Your Java heap size might be set too high.
[ERROR] Try to reduce the Java heap size using -Xmx:<size> (e.g. "
[ERROR]         at java.lang.Thread.start0(Native Method)
[ERROR]         at java.lang.Thread.start(
[ERROR]         at$
[ERROR]         at
[ERROR]         at
[ERROR]         at
[ERROR]         at
[ERROR]         at
[ERROR]         at
[ERROR]         at
[ERROR]         at
[ERROR]         at
[ERROR]         at java.nio.channels.Channels$
[ERROR]         at
[ERROR]         at com.sun.enterprise.admin.remote.RemoteResponseManager.<init>(
[ERROR]         at com.sun.enterprise.admin.remote.RemoteAdminCommand.handleResponse(
[ERROR]         at com.sun.enterprise.admin.remote.RemoteAdminCommand.handleResponse(
[ERROR]         at com.sun.enterprise.admin.remote.RemoteAdminCommand.access$600(
[ERROR]         at com.sun.enterprise.admin.remote.RemoteAdminCommand$1$1.handleReport(
[ERROR]         at org.glassfish.admin.payload.PayloadFilesManager.processReport(
[ERROR]         at org.glassfish.admin.payload.PayloadFilesManager.access$900(
[ERROR]         at org.glassfish.admin.payload.PayloadFilesManager$DataRequestType$4.processPart(
[ERROR]         at org.glassfish.admin.payload.PayloadFilesManager.processPartsExtended(
[ERROR]         at org.glassfish.admin.payload.PayloadFilesManager.processParts(
[ERROR]         at com.sun.enterprise.admin.remote.RemoteAdminCommand$1.useConnection(
[ERROR]         at com.sun.enterprise.admin.remote.RemoteAdminCommand.doHttpCommand(
[ERROR]         at com.sun.enterprise.admin.remote.RemoteAdminCommand.doHttpCommand(
[ERROR]         at com.sun.enterprise.admin.remote.RemoteAdminCommand.executeRemoteCommand(
[ERROR]         at com.sun.enterprise.admin.remote.RemoteAdminCommand.executeCommand(
[ERROR]         at com.sun.enterprise.admin.cli.remote.RemoteCommand.executeCommand(
[ERROR]         at com.sun.enterprise.admin.cli.CLICommand.execute(
[ERROR]         at com.sun.enterprise.admin.cli.AsadminMain.executeCommand(
[ERROR]         at com.sun.enterprise.admin.cli.AsadminMain.main(
[ERROR] [ERROR][thread ] Could not start thread Thread-0. Resource temporarily unavailable
[ERROR] Deployment of /home/javadev/codes/*****************.war failed.
[ERROR] For more detail on what might be causing the problem try running maven with the --debug option 
[ERROR] or setting the maven-glassfish-plugin "echo" property to "true".

We first analyzed the abnormal, see “Paged memory = 18014398505034060 k/18389412 k.” immediately startled, thought who is boring and the change of configuration information. Looking at the configuration parameters for the GlassFish startup JVM in the GlassFish console, I found nothing unusual and nothing changed compared to the other configurations. The same configuration worked well on the other test servers, initially eliminating GlassFish and JVM parameter configuration issues.
= “-bash: fork: retry: Resource permanently” (check the number of processes :

 [[email protected] ~]$ ps -ef|wc -l

But in the/etc/security/limits the conf javadev user configuration

    javadev             soft    nproc   1024
    javadev             hard    nproc   16384
    javadev             soft    nofile  2048
    javadev             hard    nofile  65536

Obviously the number of user processes has reached the limit of the limit. Change line 1 from 1024 to 2048. Problem solved. In addition, the third line 2048 can be enlarged to prevent the “too many file litres” of the program.

Read More: