Forums Register Login

How directly count of classes in the app affect memory allocation ?

+Pie Number of slices to send: Send
Just wanted to get an quick insight into how number of classes will affect memory settings. Point in question switching to another framework and the no of classes has increased by 6 folds. So just wanted to know how should we adjust memory settings ? Any help is greatly appreciated.
1
+Pie Number of slices to send: Send
The number of classes has gone up, or the number of objects? a program can use a single class, but if you create a billion objects, it's gonna use a lot of memory.

Have you used a memory profiler to see what's going on? Have you seen performance issues with the new framework? Do you have documented performance requirements?

+Pie Number of slices to send: Send
Here is little more background. I am in initial process of evaluating the performance overhead with the new framework.

Memory configuration -Xms128m -Xmx512m -XX:MaxPermSize=256m . I understand I have to change the memory settings accordingly which I will once I know the right numbers.

The changes are part of web mvc migration effort. JConsole shows number of classes has increased by over 500% ( all of it are new framework classes including all the dependencies ). The heap memory usage and CPU usage has gone up considerably but nothing alarming. The server start up time also have increased by about 60-80 seconds. The garbage collection happens at least 15 times before I get the server is ready message and also quite a few times when the app is running. Is this something I should be worried about for now ?

All the increase in number of objects should all be from new framework classes. I would like to understand on how to evaluate the performance better meaning what all things I should be looking for. I understand its a big area to cover but some pointers will definitely help me.

Appreciate the earlier reply.
+Pie Number of slices to send: Send
Always start with your requirements. How many requests should it be able to handle per minute? Does it?
How quickly should it respond to each request? Does it?
etc...

you can tweak settings all day long, but unless you have a specific goal to achieve, how will you know when you are done?
+Pie Number of slices to send: Send
I couldn't agree more with you there, but the fact of the matter is the application under load has acceptable response time. It is the server start up time that is of little concern here. How do I sped up the server start -up time based on the JConsole findings mentioned in the last post ? Also, I would like to know why the garbage collection happening at all during the start up. Please advise.
+Pie Number of slices to send: Send
General

i) Turn on trace class loading from the java command line to see which classes are loaded.
ii) turn on gc logging and look at the results in gc viewer.
iii) Get a hprof using jmap or jcmd (in your jdk) and examine the results in visualvm (in your jdk) or EclipseMat (free). In Eclipse mat run the leak suspects report.


For performance always set Xmx to same value as Xms.

If you have a huge number of classes (and have to have) set -XX:PermSize also (same value as max) each resize of permgen will full GC, you should be able to see this in your GC logs.

After that you are really into tuning the collector but its very dependent on what collector you are using ;-)

Good Luck.
+Pie Number of slices to send: Send
Why is server start-up time an issue? How often does that happen? I mean, generally, don't you start the server once, then walk away for weeks or months at a time?
Think of how dumb the average person is. Mathematically, half of them are EVEN DUMBER. Smart tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 662 times.
Similar Threads
WebLogic 6.1 SP3 - Stateful Session Bean Problem
swing and Garbage Collection
IBM Exam 157 - Questions and Answers (Sample Exam)
How to debug JBoss crashing
Eclipse memory consumption
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 07:57:01.