Appserver memory leak - Cleaning up an input parameter datas

Posted by Admin on 12-Apr-2012 07:01

I have a procedure that is causing a memory leak on a state-free appserver, but only when called from a webservices client.

This is an example of the code that is generating the leak:

def temp-table ttTest no-undo     field myfield as char     . def dataset dsTest for ttTest. define input parameter dataset for dsTest. define output parameter pc-result as character. pc-result = "hello".

Details of the leak are (the LONGCHAR/MEMPTR is never cleaned up):

DYNOBJECTS Allocated   LONGCHAR/MEMPTR 0x136ca80 size: 282 ( @ 0) DYNOBJECTS Created        X-DOCUMENT              Handle:1457 (libapp/online/web-datasettest.p @ 0) IMPLICIT  Pool:<Session Pool> DYNOBJECTS Deleted        X-DOCUMENT              Handle:1457 (libapp/online/web-datasettest.p @ 0) IMPLICIT

The dynamic objects are only generated when call the procedure over webservices:

...connect to webservice....

RUN webdatasettest in lh-webprocedure (             input dataset dsTest,             output lc-result,              output lc-output) no-error.

message lc-output view-as alert-box

However if I call the procedure as follows, none of the dynamic objects are created:

create server hServer. hServer:connect("-AppService myappserver -H myhost -sessionModel Session-Free").     RUN libapp/online/web-datasettest on hServer (         input dataset dsTest,         output lc-output). hServer:disconnect().

message lc-output view-as alert-box.

I know it has something to do with the dataset, but I am at a loss to figure out what!  I have tried cleaning it up by adding a widget pool, deleting the dataset object but with no luck as yet.  The allocation happens before any of the code is executed (have put messages in to figure this one out).  I am using the WSA with Tomcat 6.29.

Can anyone shed any light?

Chris

10.2b02, Solaris 10 64bit.

All Replies

Posted by rbf on 13-Apr-2012 02:26

I don't see any reference to a LONGCHAR or X-DOCUMENT in your code. Is there any?

Are you using FINALLY for your cleanup?

Posted by Admin on 13-Apr-2012 03:02

Nope, thats all of the code and it only happens when it is called as a web service.  The web service is exposed by the web service adapter & Tomcat.

I have a call in with progress support and they have referenced a defect which sounds similar:

Defect/Enhancement: OE00193232

A dataset is serialized as XML when passing it to the WSA,

so the AppServer writes it to a LONGCHAR and pass it out.

The AppServer allocates a MEMPTR structure for the LONGCHAR,

but never deallocated it when it is done sending the output parameter.

Though this is for 10.2B.  We're on 10.2b02 but am going to upgrade our development environment to see if it makes any difference.

Posted by rbf on 13-Apr-2012 03:15

OK so it is internal PSC code that has the defect.

Good discovery!

Interesting though that hardly anyone has run into this before.

Let us know in what release this appears to be fixed.

Posted by Admin on 16-Apr-2012 02:47

Turns out this is a OE bug.......Defect OE00220070 has been logged, along with article 000031099.

https://progress.my.salesforce.com/articles/Article/000031099

Chris 

This thread is closed