can any one please explain possible ways to happen memory leaks while using jsp and servlets in development mode?
getting pergemn space exception after started using jsp&servlets .
eclipse.ini memory spec i given :
-Xms1024m
-Xmx1024m
-XX:MaxNewSize=448m
-XX:NewSize=448m
Here are few comments/suggestions on this.
- You are getting permgen space exception. To understand this error, you need a bit of understanding of Java memory model and how the pergen space is used. Check out this link for a brief overview on this.
- Basically is region in the heap-space where the object allocated are never reclaimed by garbage collector. There are specific object types are allocated on this region (e.g. Classloaders, Literal pool etc.)
- Pergen space to be used by JVM can be specified at start up. If you don't specify, it will take some default value.
- It would be a good idea to memory-profile your application. Memory profiling gives a good insight into the actual heap usage. You can check the type and the number of objects being created and then trace them to your code which is doing this.
- There are lot of commercial and opensource profiling tools available. You can try some of them. There is VisualVM which comes bundled with JDK.
- Lastly, setting up appropriate memory settings for JVM is always tuning exercise. Its not about one size fitting all :) and profiling is very vital is tuning your application.