OutOfMemory: Java heap size

34 views
Skip to first unread message

bmnds

unread,
Feb 17, 2011, 7:04:22 PM2/17/11
to opentestbed
Hello all, I've just checked out this project and imported it in
eclipse.

Whenever I try to run CashGameConsoleStarter.java I get this error:
"994 [main] INFO
bots.mctsbot.common.handeval.spears2p2.StateTableEvaluator - Loading
evaluation tables ...
Exception in thread "main" java.lang.OutOfMemoryError: Java heap
space"

To be more precise, this is the exact part of the code, lines 96-99 at
StableTableEvaluator.java:
"ZipInputStream zipStream = new ZipInputStream(new
FileInputStream(HAND_RANKS_FILE));
zipStream.getNextEntry();
ObjectInputStream s = new ObjectInputStream(zipStream);
handRanks = (int[]) s.readObject();"

I've checked the file handRanks.zip and unziped it has aproximately
121MB, so I've increased every memory argument in eclipse.ini file in
128MB:
"-vmargs
-Xms256m
-Xmx768m
-XX:MaxPermSize=512m"

Restarted eclipse, but the problem persists. How much memory am I
supposed to have to be able to run it?

Felipe Kurkowski

unread,
Feb 17, 2011, 8:51:17 PM2/17/11
to opent...@googlegroups.com
I might be brutally wrong, but the eclipse heap space doesn't interfere
with the program you're trying to run. Instead, you're only providing more
memory to eclipse itself and not the programs you eventually build/run. 
Anyway, you should pass the Xmx argument as a VM parameter when
you run the OpenTestBed framework as every Java program runs in a 
separate VM instance.

Unfortunately, I do not use Eclipse and can't point where exactly are the
running options but it shouldn't be hard to find. In case you are unable to find 
it, you can alternatively stop using the MCTSBot (which is the source of this
problem).

Regards,
Felipe Kurkowski

Bruno Mendes

unread,
Feb 17, 2011, 10:49:33 PM2/17/11
to opent...@googlegroups.com
Thank you very much Felipe, that was exactly what was happening.

After putting -Xmx512M at Run->Run Configurations->CashGameConsoleStarter->Arguments->VM Arguments it worked just fine.

The testbed is amazing, I would like to implement a graphic client to be able to play against the bots.
At the wiki it is said that the bot is allowed to 'think for 1000ms'. Is this a limitation in the game or just a limitation to MCTS algorithm of that specific bot?

2011/2/17 Felipe Kurkowski <felipek...@gmail.com>



--
Atenciosamente,

Bruno Mendes

10º período em Engenharia da Computação
Escola Superior de Tecnologia
Universidade do Estado do Amazonas
(92) 91269828
(92) 36570670

bluegaspode

unread,
Feb 18, 2011, 2:01:27 AM2/18/11
to opent...@googlegroups.com
The testbed does not restrict the thinking time of bots, MCTSBot
restricts itself to a given thinking time.
So nothing wrong with opening/activating some GUI when a 'HumanBot'
needs to take action.

Cheers
Stefan

On Friday, February 18, 2011, Bruno Mendes <b.men...@gmail.com> wrote:
> Thank you very much Felipe, that was exactly what was happening.
> After putting -Xmx512M at Run->Run Configurations->CashGameConsoleStarter->Arguments->VM Arguments it worked just fine.
>

> The testbed is amazing, I would like to implement a graphic client to be able to play against the bots.At the wiki it is said that the bot is allowed to 'think for 1000ms'. Is this a limitation in the game or just a limitation to MCTS algorithm of that specific bot?
>
>
> 2011/2/17 Felipe Kurkowski <felipek...@gmail.com>
>
>
> I might be brutally wrong, but the eclipse heap space doesn't interferewith the program you're trying to run. Instead, you're only providing morememory to eclipse itself and not the programs you eventually build/run.
>
>
> Anyway, you should pass the Xmx argument as a VM parameter whenyou run the OpenTestBed framework as every Java program runs in a separate VM instance.


> Unfortunately, I do not use Eclipse and can't point where exactly are the
>
>
> running options but it shouldn't be hard to find. In case you are unable to find it, you can alternatively stop using the MCTSBot (which is the source of thisproblem).
>
>
>

> Regards,Felipe Kurkowski

Felipe Kurkowski

unread,
Feb 18, 2011, 1:34:45 PM2/18/11
to opent...@googlegroups.com
Bruno,

As Stefan already mentioned, the thinking time is strictly connected
to the MCTS algorithm. You may test this by running a table full of
SimpleBots (which are rule-based and, consequently, extremely fast 
bots) and you'll probably run at 1k+ hands per seconds depending on
your hardware.

I noticed that you also are Brazilian, so I might be able to help you
in our native language if you need. Just email me. My graduation 
thesis is about poker bots and you might find it useful if you plan
to develop one, as it's one of the few resources in portuguese related
to this field.

Regards,
Felipe
Reply all
Reply to author
Forward
0 new messages