18 January 2026:


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.

java.lang.OutOfMemoryError

jameztccjameztcc Members
edited November -1 in Sahi - Open Source
Hi,

I keep encountering java.lang.OutOfMemoryError when I use Sahi on e.g. http(d0t)www(d0t)flickr.com/search/?q=test&z=t .

I am testing Sahi on web2.0/AJAX applications so flickr came to my mine as a 'test' target.


thanks,
James Tan



$ sh sahi.sh
SAHI_HOME: ..
SAHI_USERDATA_DIR: ../userdata
SAHI_EXT_CLASS_PATH:
Sahi properties file = /home/..../sahi/config/sahi.properties
Sahi user properties file = /home/..../sahi/userdata/config/userdata.properties
>>>> 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 Controller
Exception in thread "pool-1-thread-5" java.lang.OutOfMemoryError: unable to create new native thread
at java.lang.Thread.start0(Native Method)
at java.lang.Thread.start(Unknown Source)
at net.sf.sahi.ProxyProcessor.run(ProxyProcessor.java:100)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception in thread "pool-1-thread-6" java.lang.OutOfMemoryError: unable to create new native thread
at java.lang.Thread.start0(Native Method)
at java.lang.Thread.start(Unknown Source)
at net.sf.sahi.ProxyProcessor.run(ProxyProcessor.java:100)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception in thread "pool-1-thread-1" java.lang.OutOfMemoryError: unable to create new native thread
at java.lang.Thread.start0(Native Method)
at java.lang.Thread.start(Unknown Source)
at net.sf.sahi.ProxyProcessor.run(ProxyProcessor.java:100)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception in thread "pool-1-thread-2" java.lang.OutOfMemoryError: unable to create new native thread
at java.lang.Thread.start0(Native Method)
at java.lang.Thread.start(Unknown Source)
at net.sf.sahi.ProxyProcessor.run(ProxyProcessor.java:100)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception in thread "pool-1-thread-3" java.lang.OutOfMemoryError: unable to create new native thread
at java.lang.Thread.start0(Native Method)
at java.lang.Thread.start(Unknown Source)
at net.sf.sahi.ProxyProcessor.run(ProxyProcessor.java:100)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception in thread "pool-1-thread-4" java.lang.OutOfMemoryError: unable to create new native thread
at java.lang.Thread.start0(Native Method)
at java.lang.Thread.start(Unknown Source)
at net.sf.sahi.ProxyProcessor.run(ProxyProcessor.java:100)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception in thread "pool-1-thread-7" java.lang.OutOfMemoryError: unable to create new native thread
at java.lang.Thread.start0(Native Method)
at java.lang.Thread.start(Unknown Source)
at net.sf.sahi.ProxyProcessor.run(ProxyProcessor.java:100)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception in thread "main" java.lang.OutOfMemoryError: unable to create new native thread
at java.lang.Thread.start0(Native Method)
at java.lang.Thread.start(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.addIfUnderMaximumPoolSize(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.execute(Unknown Source)
at net.sf.sahi.Proxy.startProxy(Proxy.java:151)
at net.sf.sahi.Proxy.start(Proxy.java:106)
at net.sf.sahi.Proxy.main(Proxy.java:78)

Comments

  • narayannarayan Administrators
    Hi James,

    Did you make any changes to sahi.properties? It seems to work fine for me.
    Any more information on browser/OS etc.?

    Regards,
    Narayan
  • Hi Narayan,

    I was using Opera 10.10, 10.50 on Linux. Haven't tried using FF yet due to the popup-blockers hindrance.

    I tried verifying in IE on Windows, worked fined without the errors. Might stay with this for the time being.

    The sahi.sh was left untouched.


    thanks,
    James Tan
  • narayannarayan Administrators
    James Tan,

    The OutOfMemoryError occurs when the browser points to Sahi's proxy and Sahi's proxy again points to itself. This circular reference can occur in 2 cases:
    1) sahi/config/sahi.properties (or userdata/config/userdata.properties) has been modified to use an external proxy which points to localhost 9999.
    2) The proxy settings are configured globally such that java itself is using the global proxy settings, in which case the java code in Sahi will connect to Sahi itself and cause a loop.

    Regards,
    Narayan
Sign In or Register to comment.