ts-7000
[Top] [All Lists]

RE: [ts-7000] Re: Java out-of-memory issue

To: <>
Subject: RE: [ts-7000] Re: Java out-of-memory issue
From: "Brian Jewell" <>
Date: Wed, 28 May 2008 08:42:00 -0700

Thanks, Mike (and also to the others that responded to my posting). This has given me something new to try.

 

I have attempted to use the Linux “free” command to track memory, but have reached the conclusion that there is only a loose relationship between the amount of free memory that the Linux kernel thinks is available and the amount of free memory the Java virtual machine thinks is available.

 

I say this because I have seen the JVM throw an OutOfMemory exception when “free” was showing ~17000 (which I believe is 17000K) of free memory. So, it would be useful to know how much free memory the JVM thinks is available.

 

--Brian

 

 


From: [ On Behalf Of mikeciaraldi
Sent: Tuesday, May 27, 2008 7:09 PM
To:
Subject: [ts-7000] Re: Java out-of-memory issue

 

--- In .com, "Brian Jewell" <brian.jewell@...> wrote:

>
> We are using a TS7250, running the Java J9 VM. Every so often, there are
> "java.lang.OutOfMemoryError" exceptions thrown in the code. There
seems to
> be no consistencies to the problem. It sometimes happens within hours of
> rebooting the TS, or sometimes within days, or sometimes not at all.

I (well, actually some of my students) had a problem like this once on
a PC running windows XP. We didn't have a profiler, so we used the
Runtime object.

You can call Runtime.getRuntime(), which returns a reference to this
virtual machine's one-and-only Runtime object. Once you have that, you
can query it for maximum, total, and free memory. So we stuck some
println()'s at strategic places in the code and watched the free
memory go up and down. We eventually found two different problems:

-- A function which was mistakenly looping too many times,
instantiating objects and sticking them into a tree. Fixing the bug
fixed the problem.

-- A function which needed to recurse quite deeply. Analyzing the
memory usage led us to start the VM with a command-line argument that
told it to ask for more memory. The analysis told us how much to ask for.

Maybe this will help...

__._,_.___

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: =Email Delivery: Digest | m("yahoogroups.com?subject","ts-7000-fullfeatured");=Change Delivery Format: Fully Featured">Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | =Unsubscribe

__,_._,___
<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU