<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
Heh. Java is a memory pig. That, however, is the nature of the beast. Sun effectively sacrificed memory for portability. As average system memory increases, that decision (as long as they can hold the jvm size stable) looks smarter and smarter.<BR>
<BR>
At this point I've run the poller for 24 hours. It is slowly increasing in size. About an extra 150 KB per hour on average. Personally, I find this extremely irritating. I am guessing that over time I have gotten complacent about variable useage. The basic assumption at this point among Java programers is that the compiler will deal with efficiency. For the most part this is true. This is an object lesson for me to not rely soley on the compiler for effeciancy.<BR>
<BR>
My next patch will focus on minimizing the memory footprint. I am going to comb through the code, and look for ways to reduce variable instantiation. I am going to not load the audio clips into memory, but instantiate them when needed.<BR>
<BR>
Since the game works in UDP I think that the ideal of making the poller work in TCP/IP, as a back up to the UDP code, is dumb. So I was also considering deleting that code. That will mean fewer variables and an overall simpler, easier to maintain, program.<BR> <BR>
Suggestions?<BR>
<BR><BR>> Message: 2<BR>> Date: Tue, 19 May 2009 15:07:41 -0500<BR>> From: Bob Tanner <basic@us.netrek.org><BR>> Subject: Re: [netrek-dev] Netrek Game On! memory usage issue<BR>> To: netrek-dev@us.netrek.org<BR>> Message-ID: <guv3id$1ba$1@ger.gmane.org><BR>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed<BR>> <BR>> On 2009-05-19 09:49:36 -0500, Jeremy Shupe <BR>> <jeremy.shupe@gmail.com> said:<BR>> <BR>> > All told, however, I can not understand how the program might have swelled<BR>> > to 300 megs of memory usage. I am trying to do a methodical analysis today,<BR>> > tracking memory usage over time. So I'll look at those results tonight.<BR>> <BR>> Lots of details missing from my irc discussion. :-)<BR>> <BR>> I never said the program (poller) leaked memory or there was anything <BR>> wrong with the poller.<BR>> <BR>> I just stated that the JVM when running the poller takes 300M. I <BR>> further stated that I think the Swing to Cocoa bridge is what is the <BR>> memory pig (not the poller).<BR>> <BR>> I have not done any testing. As far as I know 300M is the base memory <BR>> footprint for the JVM under osx.<BR><br /><hr />HotmailŪ goes with you. <a href='http://windowslive.com/Tutorial/Hotmail/Mobile?ocid=TXT_TAGLM_WL_HM_Tutorial_Mobile1_052009' target='_new'>Get it on your BlackBerry or iPhone.</a></body>
</html>