0

I need to see how my application react if I limit it to use a specific amount of memory and CPU. I am wondering how can I limit the resources for my application that is running on Tomcat and Eclipse?

I know I can use following parameters but not sure how to limit, Perm, Heap and overall Memory, and specifically CPU

-Xms1024m
    Set the minimum available memory for the JVM to 1024 Megabyte

-Xmx1800m
    Set the maximum available memory for the JVM to 1800 Megabyte. The Java application cannot use more heap memory then defined via this parameter. 
Daniel Newtown
  • 2,873
  • 8
  • 30
  • 64
  • Are you asking about how you can add these arguments in eclipse while running your application? – Kalyan Chavali Jun 29 '15 at 08:05
  • yes I need to know how to add them also they are related to memory how to limit CPU usage and heap, perm etc. – Daniel Newtown Jun 29 '15 at 08:07
  • 1
    Please have a look at this thread . You can add the memory related arguments in the VM arguments section which can be seen in a picture in the below thread . http://stackoverflow.com/questions/12222153/eclipse-how-we-take-arguments-for-main-when-run – Kalyan Chavali Jun 29 '15 at 08:10
  • @KalyanChavali thanks how about CPU? – Daniel Newtown Jun 29 '15 at 08:15
  • 1
    Please see this http://stackoverflow.com/questions/8882885/is-it-possible-to-force-an-existing-java-application-to-use-no-more-than-x-cores – Kalyan Chavali Jun 29 '15 at 08:18

0 Answers0