You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Tim Funk <fu...@joedog.org> on 2003/03/24 22:04:24 UTC

[PATCH] add JdkCompat.maxMemory() [was Re: [5.0] Monitor servlet]

Here's a patch to JdkCompat, and JdkCompat1.4

The method is called getMaxMemory() and returns -1 for jdk1.3 or less. 
Why -1? I had to pick a number. Feel free to change.

I do not have a patch yet for StatusManagerServlet. With luck, I'll have 
a patch for that(with additional functionality) in the near future.

-Tim



Bill Barker wrote:
>>>Any ideas of alternatives ?
>>
>>I've just look at the jdk souce code and this method is native :-(, so I
>>don't see an easy way to port it....Maybe you can use reflection and
>>return |Long.MAX_VALUE|
>><http://java.sun.com/j2se/1.4.1/docs/api/java/lang/Long.html#MAX_VALUE>
>>if jdk < 1.4?
> 
> 
> It would be much easier to just add a getRuntimeMaxMemory method to
> o.a.t.u.compat.JdkCompat.  That's what it's there for.