cancel
Showing results for 
Search instead for 
Did you mean: 

[RESOLVED]Example script, leaking memory

nosterling
Occasional Contributor

[RESOLVED]Example script, leaking memory

Hi, im a frequent user of SoapUI however im quite lousy at scripting.

However, im using one of the example scripts from this site looking like this

// get request property
def request = testRunner.testCase.getTestStepByName( "Request 1" );
def property = request.getProperty( "request" );

// parse out textnodes to modify
def node = new groovy.util.XmlParser(false,false).parseText(property.value);
def textNodes = node["soapenv:Body"]["sam:getContactInfo"]["String_1"][0].children()

// modify
textNodes.clear();
textNodes.add( "test" + System.currentTimeMillis() );

// write back to string
def writer = new java.io.StringWriter();
def printer = new groovy.util.XmlNodePrinter( new PrintWriter( writer ));
printer.print( node );

// set property
property.setValue( writer.toString() )



It seems though this is leaking memory somehow. Im running a load test with ONLY this script in this test just to ensure nothing else leaks, im running it with 100 threads and when it reaches the count ~1500 i get the error "java.lang.OutOfMemoryError: PermGen space"

I tried adding
printer.close ();

to the script right after

// write back to string
def writer = new java.io.StringWriter();
def printer = new groovy.util.XmlNodePrinter( new PrintWriter( writer ));
printer.print( node );

but it doesnt seem to work.


Anyone else have any ideas?
3 REPLIES 3

Re: Example script, leaking memory

Hi!

I've fixed some memory-leaks over the past weeks, can you give the latest nightly build a go to see if it improves on this? Download from http://www.eviware.com/nightly-builds and install to a seperate directory..

let me know!

regards,

/Ole
eviware.com


Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
nosterling
Occasional Contributor

Re: Example script, leaking memory

Seems to work a lot better thank you

Ill let you know if i notice anything new.

Thanks
Nils

Re: [RESOLVED]Example script, leaking memory

Great!

Thanks for testing!

/Ole
eviware.com


Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors