snarlydwarf;158419 Wrote: 
> "typically around 10-20mb" is certainly not the case I see.
> 
> Let's look again:
> USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND
> bem      20812  0.0 11.4 321052 29276 pts/3  S    09:26   0:00
> /home/bem/jre1.5.0_07/bin/java -Xbootclasspath/a
> 
> Yes, resident size is 29M... look at the virtual size: what the heck is
> it doing demanding 320M of virtual memory?
> 
Did you read what I wrote? I said that a JVM adds 10-20mb of -overhead-
to an app - in other words a Java version of Hello World would take
roughly that much memory - it's what's used by the JVM itself. I did
NOT say that all Java apps take 10-20mb of memory total - I'm
responsible for apps which have image sizes in the 10's of GB. And, I
might add, they'd take that much regardless of what language I
implemented them in.

In your example _Softsqueeze_ is taking that much memory, not "Java" -
unless you have some evidence as to what that memory is being allocated
for it's a stretch to blame some mysterious suckage of Java. More
likely, the Softsqueeze app has (for whatever reason) built a lot of
objects.

> 
> As for gcc/firefox: do recall that C makes no effort at all to provide
> for garbage collection and recycling.  I don't blame my cable company
> for not picking up the trash: it isn't something they claim to do.  I
> will blame my trash company if they don't visit, since that garbage
> collection is exactly what they promise.
Completely irrelevant. You are looking at Softsqueeze taking 320mb and
saying "that's too much" without any understanding of what's actually
going on under the hood or whether it's really using that memory. You
then proceed to blame this supposed problem on the platform which the
app is running on, again with no evidence that it is at fault in any
way. 

Remember that garbage collection only cleans up things which are
actually garbage. It's trivial to write an app which eats up every byte
of available memory in C++, it's just as easy in Java. Neither can be
held responsible for the actions of the programmer. 

(Note: I'm not laying any blame on Softsqueeze, I have no idea what
it's doing and am not suggesting it's leaky :) )

That aside, memory management under Java is a complex subject, just as
it is in any other environment. It's also handled in a very different
manner to something like C++ which leads some people to assume it's
broken just because it doesn't behave as they expect.


-- 
radish
------------------------------------------------------------------------
radish's Profile: http://forums.slimdevices.com/member.php?userid=77
View this thread: http://forums.slimdevices.com/showthread.php?t=30145

_______________________________________________
discuss mailing list
[email protected]
http://lists.slimdevices.com/lists/listinfo/discuss

Reply via email to