Tuning java

Hi!

I am politely asking for help. I am running a class extending TimeTask, in order to schedule a task. If I am not misunderstanding anything, I see that the program allocates 11M in RAM memory. I think it is too much memory allocated!

Multiplying by 100 programs scheduled it gives more than 1GB!

I tried to use those options like -Xms, or -Xmx, but the program still allocates 11M, no matter the values I pass in those options. Am I missing something?

Thank you very very much for your help!

[525 byte] By [yamm_v6.6_6a] at [2007-11-27 10:42:56]
# 1

> Hi!

>

> I am politely asking for help. I am running a class

> extending TimeTask, in order to schedule a task. If I

> am not misunderstanding anything, I see that the

> program allocates 11M in RAM memory. I think it is

> too much memory allocated!

>

Well it does not take 11 MB to schedule a TimerTask.

We can all waste alot of time discussing this or you can just get a profiler and see what is actually going on.

Playing with memory switches at runtime will do NOTHING in terms of what memory your program actually requires. As you have already discovered.

cotton.ma at 2007-7-28 19:21:29 > top of Java-index,Java Essentials,Java Programming...
# 2

I would help you correct your silly, false assumption, but I'm too busy kissing jverds @rse at the moment

georgemca at 2007-7-28 19:21:29 > top of Java-index,Java Essentials,Java Programming...
# 3

> I would help you correct your silly, false

> assumption, but I'm too busy kissing jverds @rse at

> the moment

Oi! It's way too early for this sort of mental imagery.

cotton.ma at 2007-7-28 19:21:29 > top of Java-index,Java Essentials,Java Programming...
# 4

> > I would help you correct your silly, false

> > assumption, but I'm too busy kissing jverds @rse

> at

> > the moment

>

> Oi! It's way too early for this sort of mental

> imagery.

No it isn't. It's 3:15 in the afternoon. The ideal time to imagine such things. No, wait

georgemca at 2007-7-28 19:21:29 > top of Java-index,Java Essentials,Java Programming...
# 5

> I would help you correct your silly, false

> assumption, but I'm too busy kissing jverds @rse at

> the moment

Please, this is another thread. Try to be friendly, ok? As I am trying.

I am running in Solaris environment. To discover the memory usage I am executing the top command, that gives me those informations with those columns (PID USERNAME LWP PRI NICE SIZERES STATETIMECPU COMMAND)

I see that in the RES column the 11M value is being shown. Am I seeing wrongly?

Thank you for your help. Your comments will certainly be very appreciated.

yamm_v6.6_6a at 2007-7-28 19:21:29 > top of Java-index,Java Essentials,Java Programming...
# 6

> > > I would help you correct your silly, false

> > > assumption, but I'm too busy kissing jverds @rse

> > at

> > > the moment

> >

> > Oi! It's way too early for this sort of mental

> > imagery.

>

> No it isn't. It's 3:15 in the afternoon.

No it isn't!

I even tried the -Xms and it didn't work.

cotton.ma at 2007-7-28 19:21:29 > top of Java-index,Java Essentials,Java Programming...
# 7

> Playing with memory switches at runtime will do

> NOTHING in terms of what memory your program actually

> requires. As you have already discovered.

Ok, thank you very much. I just wanted to confirm this fact.

yamm_v6.6_6a at 2007-7-28 19:21:29 > top of Java-index,Java Essentials,Java Programming...
# 8

> > I would help you correct your silly, false

> > assumption, but I'm too busy kissing jverds @rse

> at

> > the moment

>

> Please, this is another thread. Try to be friendly,

> ok? As I am trying.

>

> I am running in Solaris environment. To discover the

> memory usage I am executing the top command, that

> gives me those informations with those columns (PID

> USERNAME LWP PRI NICE SIZERES STATETIME

>CPU COMMAND)

> see that in the RES column the 11M value is being

> shown. Am I seeing wrongly?

>

> Thank you for your help. Your comments will certainly

> be very appreciated.

You need a JAVA profiler to see what parts (Objects) of your program use what memory. The total is of no concern.

As I said before scheduling a task is not 11MB but there is some overhead and more importantly how large the rest of your program is.

cotton.ma at 2007-7-28 19:21:29 > top of Java-index,Java Essentials,Java Programming...
# 9

> > I would help you correct your silly, false

> > assumption, but I'm too busy kissing jverds @rse

> at

> > the moment

>

> Please, this is another thread. Try to be friendly,

> ok? As I am trying.

This is my rude, sincere replying style, tuned for trolls. You don't get to switch it off and pretend you haven't been insulting toward members of the forum just because now you need some help. Did you try that restaurant experiment yet?

georgemca at 2007-7-28 19:21:29 > top of Java-index,Java Essentials,Java Programming...
# 10

> > > > I would help you correct your silly, false

> > > > assumption, but I'm too busy kissing jverds

> @rse

> > > at

> > > > the moment

> > >

> > > Oi! It's way too early for this sort of mental

> > > imagery.

> >

> > No it isn't. It's 3:15 in the afternoon.

>

> No it isn't!

>

> I even tried the -Xms and it didn't work.

throws WrongSideOfPondException

:-)

georgemca at 2007-7-28 19:21:29 > top of Java-index,Java Essentials,Java Programming...
# 11

> > > I would help you correct your silly, false

> > > assumption, but I'm too busy kissing jverds @rse

> > at

> > > the moment

> >

> > Please, this is another thread. Try to be

> friendly,

> > ok? As I am trying.

>

> This is my rude, sincere replying style, tuned for

> trolls. You don't get to switch it off and pretend

> you haven't been insulting toward members of the

> forum just because now you need some help. Did you

> try that restaurant experiment yet?

Thanks anyway for your sincerity.

yamm_v6.6_6a at 2007-7-28 19:21:29 > top of Java-index,Java Essentials,Java Programming...
# 12

> > > > I would help you correct your silly, false

> > > > assumption, but I'm too busy kissing jverds

> @rse

> > > at

> > > > the moment

> > >

> > > Please, this is another thread. Try to be

> > friendly,

> > > ok? As I am trying.

> >

> > This is my rude, sincere replying style, tuned for

> > trolls. You don't get to switch it off and pretend

> > you haven't been insulting toward members of the

> > forum just because now you need some help. Did you

> > try that restaurant experiment yet?

>

> Thanks anyway for your sincerity.

Any time. See, this is the problem with your apparently sincere, rude approach. It alienates people. Had you not been so, I would happily have helped.

Call me an @sshole if you like, but I'm giving you a visible demonstration of what actually happens when you have that attitude. The guy on the other end of the phone, the waiters, the NetBeans team, the mechanic, whoever, will almost always act like this. Of course, in the end they'll have to help you (NB team aside) because they're paid to. But behind the scenes you're being treated with this contempt, and it'll be reflected in the quality or expediency of the help you're after

You could always apologise for being rude

georgemca at 2007-7-28 19:21:29 > top of Java-index,Java Essentials,Java Programming...
# 13

LOL, this is all just too f***ing funny. He has the chutzpah to come back and ask for help?

Lesson learned: Be careful who you piss off, cuz you might need them someday.

petes1234a at 2007-7-28 19:21:29 > top of Java-index,Java Essentials,Java Programming...
# 14

> LOL, this is all just too f***ing funny. He has the

> chutzpah to come back and ask for help?

>

> Lesson learned: Be careful who you piss off, cuz you

> might need them someday.

Guy I used to work with was once on his way to an interview. He stopped at the motorway services for a toilet break, and got into a minor argument with some guy taking "too long" at the hand drier

Guess who was interviewing him.....

georgemca at 2007-7-28 19:21:29 > top of Java-index,Java Essentials,Java Programming...