I have a .NET WCF Client that been wrapped in a COM wrapper so Powerbuilder (12.5.2) can call it. All the WCF Client does it call a web service that returns some rows of data and then passes them back to Powerbuilder. Here is the PB code that does the call:
Any l_any[]
this.ufpv_connect() // Connect to the COM wrapped WCF Client
l_any = iole_wcf_client.tcp_d_maint_client_store_data_ret()
this.ufpv_disconnect() // Disconnects and destroys iole_wcf
If I call this in a loop the memory just increases each time, until I get a system error. I have tried adding yields and garbagecollect everywhere to no avail. If I run it from the PB IDE the memory may easily go from 21MB to 1GB (it's a lot of data) after 30 or so loops. If I then close the program and go back to the IDE then the memory is still held by the PB125.exe.
Am I missing something? Do I have to do something extra in Powerbuilder or in the .NET COM client to free the memory? I was expecting the memory to jump once because of course I have some new data but then stay around that level since the next retrieve is the same data into the same variable.
I've tested the .NET client but turning it into a console app and running it in a loop, it does what I would expect: memory goes up as it retrieves then stays around the same as it loops (sometimes it goes up more than expected but it soon drops back). So I think it's not the C# code that's leaking, possibly, maybe - if only I knew what I was doing
Thanks for any help