GC overhead limit exceeded

Asked by rod

Hi all,

I'm experiencing a weird problem.
I've a sikuli-1.0.1 installed on a Windows7 (X64) with JRE7 and I'm writing a huge number of unit tests by using the Sikuli API.

In some of my unit test, I'm creating a lot of temporary referenced objects in memory (... and I'm obliged to do that ...) and, after a while, I get the following error :

[error] java.lang.OutOfMemoryError ( java.lang.OutOfMemoryError: GC overhead limit exceeded )

I knew this is due to the fact that the garbage collector is taking an excessive amount of CPU and recovers very little memory and this error is intended to prevent the application from soaking up CPU time without getting anything done.

What can I do ?
What do you suggest me ?

Thanks a lot,
Rod

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

Did you already raise the memory limits for the JVM (either in your IDE or on command line with the respective -X options) to what you can afford on your machine?

Revision history for this message
rod (rodhiguain) said :
#2

No, I did not.
Could you tell me how ?
Which X option ?

I'm running my tests in command line : runIDE.cmd -r mytest.sikuli

Thanks

Revision history for this message
Best RaiMan (raimund-hocke) said :
#3

java has these two parameters, to adjust the memory settings

    -Xms<size> set initial Java heap size
    -Xmx<size> set maximum Java heap size

in runIDE.cmd on line 5 we use this:
set PARMS=-Xms64M -Xmx512M -Dfile.encoding=UTF-8 -Dsikuli.FromCommandLine

you might make a copy and change e.g.
-Xmx1024M

or even more. You have to test.

Take care to keep the other settings as above.

Revision history for this message
rod (rodhiguain) said :
#4

Thanks a lot RaiMan !

Revision history for this message
rod (rodhiguain) said :
#5

Thanks RaiMan, that solved my question.