maximum memory for gcj-compiled executable?

Per Bothner per@bothner.com
Mon Mar 24 08:06:00 GMT 2003


Erik Poupaert wrote:
> I would need commandline options initheapsize=... maxheapsize=... to keep a
> lid on the memory consumption of a gcj executable. For a GUI it doesn't
> really matter, but the current unconstrained memory consumption is quite
> dangerous for server processes. I've been informed that my xmlrpc servant
> quite likely brought down the win2k server on which it was installed. In
> absence of free memory, the server wasn't doing any useful work any longer.

(I guess I wasn't paying attention - this might more reasonably
be a run-time option rather than a compile-time option.)
So you want an option to constrain a program that is well-behaved
enough to obey a maxheapsize option, yet buggy enough to eat up
all your memory without that option? That seems like a weird
request to me.
On Unix-like systems we can constrain the maximum memory usage
of a process - without cooperation from that process. Doesn't
Win2k have something like that?
In any case, presumably you need to figure out what is going on
- why the heap keeps growing. If the amount of data is really
growing, setting a maxheapsize won't help - all it can do is
abort if the max is exceeded.
It sometimes help to carefully null out fields or variables that
might point to data strcutures that are no longer needed. (I
have't been following the discussion, so perhaps my suggestions
are redudant or irrelevant.)
-- 
	--Per Bothner
per@bothner.com http://per.bothner.com/


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /