title: How to Set Max User Processes on Kubernetes
body: <p>I built a docker container for my jboss application (wildfly11 in used). Container ran in AWS EKS Fargate. After running the container for several minutes, “java.lang.OutOfMemoryError: Unable to create new native thread ” occurred.</p>
  <p>After reading this article “<a href="http://www.mastertheboss.com/jbossas/monitoring/how-to-solve-javalangoutofmemoryerror-unable-to-create-new-native-thread/" rel="nofollow noreferrer">How to solve java.lang.OutOfMemoryError: unable to create new native thread</a>”, I would like to change the max user processes from 1024 to 4096. However, I can't find any possible way to change it by reading the documentation in kubernetes.</p>
  <p>I have tried those methods in this article <a href="https://stackoverflow.com/questions/33649192/how-do-i-set-ulimit-for-containers-in-kubernetes">How do I set ulimit for containers in Kubernetes?</a> , but it seems cannot help.</p>
  <p>I have also edited the file <code>/etc/security/limits.conf</code> in my Dockerfile, but the number still hasn't changed.</p>
  <p>Anyone have an idea about this?</p>
  <p>Thank you.</p>