18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
Getting error "java.lang.OutOfMemoryError: Java heap space"
I run the sahi.bat.
Then while trying to open the Firefox browser I am getting error.
>>>> Sahi started. Listening on port:9999
>>>> Configure your browser to use this server and port as its proxy
>>>> Browse any page and CTRL-ALT-DblClick on the page to bring up the Sahi Con
roller
Exception in thread "Thread-1365" java.lang.OutOfMemoryError: Java heap space
So this error is not letting the browser open since yesterday.
And even if the browser opens when the sahi.bat not running , the sahi interface controller is not running.
I have jdk1.5.0_06. How do I increase the heap size.
Please help me to solve it.
Thanks,
Mitu
Then while trying to open the Firefox browser I am getting error.
>>>> Sahi started. Listening on port:9999
>>>> Configure your browser to use this server and port as its proxy
>>>> Browse any page and CTRL-ALT-DblClick on the page to bring up the Sahi Con
roller
Exception in thread "Thread-1365" java.lang.OutOfMemoryError: Java heap space
So this error is not letting the browser open since yesterday.
And even if the browser opens when the sahi.bat not running , the sahi interface controller is not running.
I have jdk1.5.0_06. How do I increase the heap size.
Please help me to solve it.
Thanks,
Mitu
Tagged:
Comments
Sahi generally uses very little memory. This error happens sometimes if you have configured the external proxy of Sahi to point to itself. Could you paste your sahi.properties file here?
Btw, what is the RAM on your machine and do you run a lot of other applications which may lead to scarcity of memory?
If you still want to increase the heapsize,
Open sahi/bin/sahi.bat and change
java -classpath %EXT_CLASS_PATH%;%SAHI_CLASS_PATH% net.sf.sahi.Proxy
to
java -Xms32m -Xmx128m -classpath %EXT_CLASS_PATH%;%SAHI_CLASS_PATH% net.sf.sahi.Proxy
32 is the initial help size and 128 is the max heap size. Change it to whatever you want.
Regards,
Narayan
Set
ext.http.proxy.enable=false
and
ext.https.proxy.enable=false
if you do not use an external proxy to access the internet.
Is there are a reason why you set it to true?
Do you generally use a proxy to access the internet?
If yes, in sahi.properties, you have to set the host and port of YOUR proxy and not Sahi's proxy.
Example:
If you used to configure your browser to use myintranetproxy:808 to access any website on the internet (before using Sahi), you will have to set
ext.http.proxy.host= myintranetproxy
ext.http.proxy.port=808
and
ext.https.proxy.host= myintranetproxy
ext.https.proxy.port=808
in sahi.properties
So, what was previously
Browser -> myintranetproxy:808 (configured on browser) -> web site
now becomes
Browser -> localhost:9999 (Sahi proxy, now configured on browser) -> myintranetproxy:808 (external proxy, now configured in sahi.properties) -> web site
Let me know if you still cannot get it working. You can also call me at 98809 65555, if needed.
Regards,
Narayan
But I am not sure why it is not working for Internet explorer.The Sahi interface controller is not coming up.
Could you please let me know.
Thanks,
Mitu
-Xms128m -Xmx512m
This made it take longer to throw the exception.
Then I checked my sahi.properties, the external proxy had no settings, but both were set to enable=true. So I changed both to enable=false, restarted the proxy - this time it took a really long time when I started playback, but it still threw the exception.
This was working fine all morning, then suddenly I got this the first time about an hour ago. I can't think of anything significant that changed that may have caused this...
Now what?
I tried using IE8 (was using firefox before) - IE seems to ignore my proxy settings, so the controller window can never come up. (When I turn off the proxy, IE is still able to browse the internet, no matter that the proxy config is set to use SAHI).
The specialized functions file also includes the same standard functions as the main script - so the standard stuff got included twice.
So I removed the include statement from the functions file, now it's working.
So this leads to a question: SAHI obviously concatenates all the scripts into one before executing - how big is this combined chunk of code allowed to get?
I think, the OME would not be because of the number of scripts or duplication. Do you have a date.js library included? There was a recursion problem in an open source date library which arose when run in the rhino engine. You could try eliminating scripts one by one and figure which one is errant.
Regards,
Narayan
Yes, we do use date.js - that is one of the "standard" includes that happened twice.
Thank you!
Johan
I also have the same issue.
I tried what you mentioned above but the issue not resolved help me please
I also have the same issue.
I tried what you mentioned above but the issue noe resolved help me please