Java `OutOfMemoryError` when creating < 100 threads

后端 未结 4 1868
醉梦人生
醉梦人生 2020-12-16 17:26

I\'ve been reading and testing and banging my head on the wall for over a day because of this error.

I have some Java code in a class called Listener t

4条回答
  •  天命终不由人
    2020-12-16 17:36

    You can be limit by max user processes, to know your limit use :

    ulimit -u
    

    To change the limit :

    In /etc/security/limits.conf set :

    user soft nproc [your_val] 
    user hard nproc [your_val]
    

    You may have to add some other config if it's not enough see this link.

    Note : The OP found this bug report in fedora and centos which explains the limitations of editing /etc/security/limits.conf.

提交回复
热议问题