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 heap error

Rhubarb3.1415Rhubarb3.1415 Members
edited November -1 in Sahi - Open Source
Getting a java heap error.
This occurs during a "Record" after a:

_click(_link("Download"));

Here is the error as printed to the terminal where I start ./sahi.sh

Exception in thread "Thread-256" java.lang.OutOfMemoryError: Java heap space
at net.sf.sahi.util.Utils.getBytes(Utils.java:64)
at net.sf.sahi.StreamHandler.populateData(StreamHandler.java:44)
at net.sf.sahi.response.HttpResponse.<init>(HttpResponse.java:50)
at net.sf.sahi.RemoteRequestProcessor.processHttp(RemoteRequestProcessor.java:101)
at net.sf.sahi.RemoteRequestProcessor.processHttp(RemoteRequestProcessor.java:75)
at net.sf.sahi.ProxyProcessor.processAsProxy(ProxyProcessor.java:128)
at net.sf.sahi.ProxyProcessor.run(ProxyProcessor.java:85)
at java.lang.Thread.run(Thread.java:636)

This happens after I've just started sahi and only four steps into this recording.

Thanks

Comments

  • Solved my own problem.
    Made a change to the sahi.sh file.
    Changed :
    java -classpath $EXT_CLASS_PATH:$SAHI_CLASS_PATH net.sf.sahi.Proxy
    To:
    java -classpath $EXT_CLASS_PATH:$SAHI_CLASS_PATH -Xms32m -Xmx256m net.sf.sahi.Proxy
    Where the value for "-Xmx256m" has to be larger than the size of the file to be downloaded.
  • narayannarayan Administrators
    Rhubarb,

    Good catch and thanks for the solution. The file download can be optimized to not take up so much memory. I will have a look at it.

    Regards,
    Narayan
Sign In or Register to comment.