Page 4 of 5

Re: java heap size error

PostPosted: 13 Feb 2010, 00:22
by Chris H.
LutherBlissett wrote:with Textpad you need to select the menu item (Convert to Simple Text) and then you can save it as a unicode txt file.
Then you need to Right/Click and set it to load in Terminal.app at all times.
`
OK, I now follow what you did. NetBeans is the default on my computer but I can set this to Terminal for this one file. Excellent.

Re: java heap size error

PostPosted: 13 Feb 2010, 01:09
by DennisBergkamp
Liuther,

What happens when you use -Xmx256 instead ?

Re: java heap size error

PostPosted: 13 Feb 2010, 01:49
by LutherBlissett
DennisBergkamp wrote:Liuther,

What happens when you use -Xmx256 instead ?
Almost the same result.
Game 1 - 42 cards played - play game till end
Game 2 - no cards played - error on first mouse over

EDIT: just to elaborate - in both cases I hit "Continue Match" without going back to the Main Menu.

Re: java heap size error

PostPosted: 13 Feb 2010, 03:30
by Rob Cashwalker
Are HQ images really worth all this hassle?

When they're shrunk to fit the game area, they're just as unreadable.
The picture on the right side is just as good with a normal pic.
The variable-width picture panel then makes LQ pics suck because they get scaled up.
Adding Google Collections has bloated the project like a Microsoft product.
Downloading the HQ pics is an insane undertaking, even on broadband.
And, oh-yeah, there's this heap space error.....

Re: java heap size error

PostPosted: 13 Feb 2010, 03:46
by DennisBergkamp
For me they're definitely worth using (even though there's a very slight drop in performance).

But yeah, I would suggest just switching to LQ images if you keep getting the heap space error. I don't know how to solve it :(

Re: java heap size error

PostPosted: 13 Feb 2010, 04:06
by Huggybaby
C'mon Rob, a few hundred MB is an insane undertaking on broadband?

Re: java heap size error

PostPosted: 13 Feb 2010, 04:18
by LutherBlissett
Rob Cashwalker wrote:Are HQ images really worth all this hassle?

In the context of my 4yr old XP laptop with 15" screen and maximum 1280x1020 res... no they are not worth the hassle.

But in terms of my 1.5yr old Macbook Pro with 17" screen and 1920x1280 res... yes they are...
I can't read the LQ cards properly when they are blown up to a readable size.
Of course I can just read the description in the top left but that takes away from appreciating the card art AND the rules in one glance.

I'm persisting with this I guess because I feel that it is something that should be solveable, might even be down to certain configurations of JAVA / OS. I like the AI in forge (though it could be more aggressive at times) and the ability to try different decks/cards makes it more enticing than playing proper Magic Online (which I have an account for as well but have temporarily given up on).

Dennis - please don't give up yet..!
Still want to see how I can check that putting the -Xmx command in a shell script is ACTUALLY changing the heap space (because it appears to be doing nothing.)
Also was going to watch the activity monitor to see if I could workout how memory management is being reported.

Re: java heap size error

PostPosted: 13 Feb 2010, 04:31
by Huggybaby
Of course it's solvable.
And I just downloaded the 431 MB from my MediaFire links in less than 10 minutes.

It might not even be a memory leak. Anyone heard of finalization? (Not me, just asking.)
http://java.sun.com/javase/6/webnotes/t ... leaks.html

Re: java heap size error

PostPosted: 13 Feb 2010, 04:54
by LutherBlissett
So I just got the error and I'm looking at the Activity Monitor - this is with the -Xmx256m command in shell, focusing forge.Gui_NewGame Real and Virtual Memory values.

At instantiation of run-forge.jar:
RM=54.06 / VM=1.18gb

At start of game:
RM=90.67mb / VM=1.19gb

On Error:
RM=159.61mb / VM=1.23gb

So it trebles in memory usage from start to end but that does not seem out of the ordinary - i'm more interested in the idea that if I have a 256mb heap space, why is it giving the error at 159.61mb ??

Re: java heap size error

PostPosted: 13 Feb 2010, 05:04
by DennisBergkamp
Exactly, that's what I'm wondering too #-o

Re: java heap size error

PostPosted: 13 Feb 2010, 08:13
by silly freak
System or Runtime provides infos about the VM, we could check there for the actual heap size

Re: java heap size error

PostPosted: 13 Feb 2010, 09:34
by silly freak
those of you experiencing the memory problems, please use this option when running forge:
Code: Select all
-XX:+HeapDumpOnOutOfMemoryError
this will create a file containing java's memory usage when an OutOfMemoryError occurs. If you upload it, we can better analyse where the leak lies

(For developers: the jhat utility that ships with java can analyse such file. use
Code: Select all
jhat <<file>>
and open localhost:7000 (or what port jhat says) in your browser)

Re: java heap size error

PostPosted: 13 Feb 2010, 11:34
by Chris H.
Rob Cashwalker wrote:The variable-width picture panel then makes LQ pics suck because they get scaled up.
`
I also noticed that a LQ pic that is scaled up past 1x becomes unreadable. I wonder if the resize code could be limited to max of 1x?

Re: java heap size error

PostPosted: 13 Feb 2010, 14:36
by LutherBlissett
silly freak wrote:those of you experiencing the memory problems, please use this option when running forge:
Code: Select all
-XX:+HeapDumpOnOutOfMemoryError
this will create a file containing java's memory usage when an OutOfMemoryError occurs. If you upload it, we can better analyse where the leak lies

I get a "Command Not Found" error when I add that to the shell script.

Re: java heap size error

PostPosted: 13 Feb 2010, 16:31
by silly freak
like that:
Code: Select all
java -XX:+HeapDumpOnOutOfMemoryError -jar run-forge.jar