<div>The ss was taken after the program had been running for about an hour. I've looked at it after it has been running for several hours and noticed a small uptick in the memory useage. Zach told me that there are peeps complaining that it was taking up to 300 mb. I looked over the code, and cannot understand that assertion. There are, however, things I could do to make the code more efficient, such as variable reuse, assuming that the compiler isn't doing that already.</div>
<div> </div>
<div>Admittedly; most Java programmers have gotten lazy as we rely on the compiler to much.</div>
<div> </div>
<div>Another thing that I can do to minimize the memory footprint is not pre-load the audio clip objects. I actually have 2 sound engines, one for small apps, such as this, that pre loads the audio clips into memory and calls them as needed. The other engine maintains a cache, it checks the cache and plays the clip if it finds it there, if not, it creates the file, plays it, and inserts it into the cache.</div>
<div>This means that only files that are being used are loaded into memory. This frees up memory in exchange for runtime response. As an added feature the engine also tries to "garbage collect" the cache by routinely investigating how long it has been since each loaded file has been used, and deleting the ones that haven't since the last sweep.</div>
<div> </div>
<div>In this case, where the program is only playing a clip every 60 seconds, at maximum, runtime response is not a factor.</div>
<div> </div>
<div>All told, however, I can not understand how the program might have swelled to 300 megs of memory usage. I am trying to do a methodical analysis today, tracking memory usage over time. So I'll look at those results tonight.</div>
<div> </div>
<div>I can not log onto the newsgroup from here (<a href="mailto:$@%$#@!$%">$@%$#@!$%</a> web nanny, I seriously need to set up a vpn tunnel to my home machine, but then again, even with the nanny I do blow lots of time on "stuff", like this email) but I am preparing a post to the iPhone thread: Let me know what you think.</div>
<div> </div>
<div>I had similar thoughts when Microsoft allowed ordinary hacks to program games for the xbox. (Netrek on the xbox, COOL!!) Peeps in this thread are assuming a full client, although there has been mention of a stand alone single player version. My thoughts on this subject are this:</div>
<div>1. The single player version is the best option. Everybody is assuming a full blown client. That opens a huge can of worms. There are issues involved such as airtime (You don't think the cell companies are going to let iPhone users play Netrek without charging for something, bandwidth, airtime, oxygen, ... do you?). Play balance, a cell phone user will get their asses handed to them, get frustrated and regret not spending that $1 that they paid for the app on a McDonald's cherry pie, etc.</div>
<div> </div>
<div>If, however, we created a scaled down single player version, say a universe with a total of 10 planets, for example 5 Ori, and 5 Fed, then there are allot of possibilities. Messaging would be dead and the galactic map could take the space used by the messaging and player windows.</div>
<div> </div>
<div>The point behind this version, would be to get people interested in Netrek, and to get them some sort of practical training. All the time that they are playing, or maybe at launch and closing, we would be sending messages such as "If you like this, go download and play the full game, for free, at blah" A portion of the peeps would go home, download the game, and join the community. If that was even 1/2 of 1% of iPhone users that would still be a huge increase of new blood.</div>
<div> </div>
<div>In short, I am taking the middle road between the opinions issued here. That yes, a iPhone, or handheld version of the game is appropriate, but that that version should not be a full blown client, and should be used primarily as a recuiting and training tool.</div>
<div> </div>
<div>2. Now we are talking $$$. Money make people crazy. What must be stated clearly BEFORE work begins on such a project is who gets the proceeds, and how those proceeds will be spent. I don't know who developed the code base. My assumption is that the number of contributors is at least several score, if not over a hundred. Before anyone proceeds on such a venture they need to be covered to ensure that those individuals are not going to sue for a cut of the pie.</div>
<div> </div>
<div> </div>
<div>Finally, I am not on the developer email list, and would like to be added.</div>
<div>primary email: <a href="mailto:coljlc1863@hotmail.com">coljlc1863@hotmail.com</a></div>
<div>secondary email: <a href="mailto:jeremy.shupe@gmail.com">jeremy.shupe@gmail.com</a></div>
<div> </div>
<div>Thanx</div>
<div>Jeremy<br><br></div>
<div class="gmail_quote">On Mon, May 18, 2009 at 5:36 PM, James Cameron <span dir="ltr"><<a href="mailto:quozl@us.netrek.org">quozl@us.netrek.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div class="im">On Mon, May 18, 2009 at 10:30:30AM -0400, Zachary Uram wrote:<br>> Someone in IRC (I think it was Bob Tanner) mentioned that running the<br>> poller application under OS X was eating up over 300MB of system<br>
> memory.<br><br></div>Bob, take a look at OS X's Java VM for a hello world. Exclude cache.<br>
<div class="im"><br>> I talked to Jeremy and he said this should not be happening<br>> and that there should not be any memory leaks in his app.<br><br></div>Good.<br>
<div class="im"><br>> Here is a<br>> screenshot he sent me (he is running MS Windows Vista I think) showing<br>> only 19MB of memory being used:<br>><br>> <a href="http://www.jesujuva.org/mem-usage.jpg" target="_blank">http://www.jesujuva.org/mem-usage.jpg</a><br>
<br></div>Irrelevant. It is the trend that is important. Measure the usage at<br>hourly intervals. Or if this was taken after some hours say so.<br><br>I wouldn't be surprised to find it is a feature of the virtual machine<br>
in use. Zach, why don't you load up a Java VM yourself and test it out,<br>that way we'd get the Linux data point.<br><br>As another data point, the metaget program that I use takes a peak of<br>2Mb virtual memory, 644Kb physical memory, and is 13k on disk. The<br>
large difference between the on-disk size and the peak virtual memory<br>size is caused by the very large C run time library.<br><br>Jeremy, are you on the netrek-dev mailing list yet?<br><font color="#888888"><br>--<br>James Cameron mailto:<a href="mailto:quozl@us.netrek.org">quozl@us.netrek.org</a> <a href="http://quozl.netrek.org/" target="_blank">http://quozl.netrek.org/</a><br>
</font></blockquote></div><br><br clear="all">
<div></div><br>-- <br>Just because you are paranoid, doesn't mean the world isn't out to get you.<br>