Service running too long and causing out of memory

My server is running out of memory, because there are hung threads by running long services under service usage.

Can you tell me what could be the possible reasons for this. I have checked my service and found that its working with huge data in the memory (say more than 500k) and also doing things like append to string for each record, and not dropping the values from the pipeline.

Is there any best practices to avoid long running services?


The usual cause of hung threads is programming bugs in the services.

Also, working with large documents and not dropping vars from the pipeline when no longer needed can be problematic.

Did you mean “append to string” or is it “append to string list?” Depending on the IS version and the JVM, the append to list services can become very slow after a few hundred elements are added.


Just to add to Rob’s response.

The webMethods IS is a JVM.
A string is a class of it own and not a primitive data type ( like int,float…etc). when a String is created, JVM allocates memory for the object, and stored in a reference, say ‘X’. when you create a new string object and assign to the reference ‘X’, the memory allocated for the previously created string will still exist on the JVM memory. For any string object the allocated memory has to be deallocated in order to prevent memory leaks.

Thanks and Regards,


All were saying of deallocation… but how that thing is done ?? :frowning:

In FLOW services, drop variables that are no longer useful as soon as possible.