How to reduce my application memory !



Hi i am Jprofiler to find the memroy taken of my applccation ?

How can i reduce that ? and how can i use to find my performences of my application  app Mem
LVL 20
Sathish David  Kumar NArchitectAsked:
Who is Participating?
 
__geof__Commented:
You are using 5MB of memory so I wouldn't worry about that. But if you really want to save some, you yould set the String you use to null when you finished using them but it would be really little gain.
0
 
Sathish David Kumar NArchitectAuthor Commented:
ya i already did that!!!
0
 
Sathish David Kumar NArchitectAuthor Commented:
what to increase the performances??
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
hackpinCommented:
set all char[] arrays to null including String variables after using it. or use sorted list so you can manage the strings you used...
0
 
lizzzardCommented:
geof,

I agree with dravidnsr there's nothing to worry about. However, if you really want advice on this, you should give far more information or show your sourcecode. There's not much we can do with just that picture.
0
 
ErdyMurphyCommented:
i would look at the telemtry overview of the whole the runtime...
we dont know if this is only one point of time in the picture...
the telemetry overview shows you the memory over the whole runtime
0
 
__geof__Commented:
char[] are most probably the String you use and there are most of the memory used. If you want something more efficient, there is probably other things to do in the code. But the, as lizzard says, we should see the code.
0
 
Sathish David Kumar NArchitectAuthor Commented:
its a securtiy reason i will not able post code here ...

But other than code ...
0
 
__geof__Commented:
the usual:
* switch - case instead of many if else
* do not return something from a method if not meeded
* minimize your loops (move out of a loop everything that can be moved out)
* try to avoid exception
* reuse objects instead of creating new ones
0
 
Sathish David Kumar NArchitectAuthor Commented:
>>do not return something from a method if not meeded
Why if it return means is it take more sepace ?

>>>>>>try to avoid exception
I am not getting this point
0
 
Sathish David Kumar NArchitectAuthor Commented:
What about session and request object ?

I am using 5% session object in my code ! and 20 % request object setting in my code ?

is that effect my code ?? performances !!
0
 
__geof__Commented:
Is it an J2EE application? Then yes, request objects "die" after the request but the session objects "live" the whole session. So you should always use the "shorter lived" object possible. But if you have only 5%, I guess there is not much to gain there either.

Do you have a performance problem as it is or are you trying to optimize? If there is a problem, it could be a good idea to specify the problem?
0
 
Sathish David Kumar NArchitectAuthor Commented:
try to optimize but  i want know performances kind of things also !

Now the size is increase to 8 MB i didnt chang anything how its possible !!
0
 
__geof__Commented:
If you are running on tomcat and have session object, each time you browse to your webapp, it will grow in memory. In addition, if your are checking the whole tomcat memory, it grows for each time your re-deploy a webapp.
0
 
Sathish David Kumar NArchitectAuthor Commented:
Oh then ..  if i dont restart the server means it will increase the size right ??

how to kill request object !
0
 
__geof__Commented:
Why would you want to do that? They die when the request is done.
0
 
Sathish David Kumar NArchitectAuthor Commented:
>>>>>>They die when the request is done.

Oh thats thing is common right ...
0
 
__geof__Commented:
something like all web servers work like that
0
 
Sathish David Kumar NArchitectAuthor Commented:
While i run the application ...

It goes to 18 MB ? is that working fine ??
0
 
gordon_vt02Commented:
It really depends on your application.  If it is using objects that require 18MB of memory, then yes.  Unless you are actually seeing performance issues, optimizing might be a waste of time and may actually create more problems than it solves.  If you start having problems with slow performance or you are running out of memory, then start looking for the bottlenecks and fixing them.
0
 
__geof__Commented:
When a web application runs, over time, it is not unusual that it grows its memory use. It also may depend on the number of connections at a same time, number of sessions, etc...
As long as it doesn't grow out of proportion and the application is working as it is supposed to, it really is not an issue.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.