devcartel / pyrfa

Open sourced Python API for Refinitiv (Thomson Reuters) Enterprise Platform.
http://devcartel.com/pyrfa
MIT License
50 stars 15 forks source link

Pyrfa does not clean up properly #13

Closed ghost closed 8 years ago

ghost commented 9 years ago

p = pyrfa.Pyrfa() There is no elegant way to clean up memory occupied by "p". Killing the process seems to be the only way. "del p" doesn't work.

Please provide a reliable way to clean up this object.

wiwat-tharateeraparb commented 9 years ago

We detect a memory leak in data dictionary related function where dictionary is not properly removed when object is destroyed. Will fix this in the next release.

Having said that, with the fix in place, the "del p" command still does not release full memory back to the OS. It depends on Python object management.

ghost commented 9 years ago

Good to know. Thanks for the planned fix.

wiwat-tharateeraparb commented 9 years ago

Just released 8.0.0.2 which includes this fix.

ghost commented 9 years ago

Thank you very much. We only have Python 2.7 (32bit) - any chance you can make a release for 32bit version?

ukrit-himakoon commented 9 years ago

Please clarify if the platform is windows or linux with the specific version.

ghost commented 9 years ago

Microsoft Windows Server 2003 - Enterprise Edition, Service Pack 2

ghost commented 9 years ago

I've been using 7.6 successfully on this machine - except the memory issue. I can't really upgrade the python to 64 bit even if the machine allows it - because it is difficult to get it in my organization.

ghost commented 9 years ago

Let me give you a little bit more detail - since you guys are quite fast and I'm feeling hopeful. I have this real-time (almost) app that frequently fetches prices from RMDS (DTS/ATS) servers. When I try to create one session and keep reusing it, my app just hangs forever without any trace. When I try to re-initialize session every time I want to fetch prices, it keeps inflating the memory of my windows service (pythonservice) and I have to restart this service every now and then (automatically of course :) )

I can't copy paste the actual code so in pseudocode terms:

session=Pyrfa(); # And do login/initialization etc. for all RICs: session.marketPriceRequest(RIC)

while a reasonable amount of time has passed or all updates have been received: updates = session.dispatchEventQueue(1000) check updates

I'm sure there are other people out there looking for this package to work with Python 2.x, 32bit. Continuing a release in that branch might not be a bad idea. Thanks a lot for all your effort!

ghost commented 9 years ago

Will there be a Windows (x86 + Python2.7) release for latest version by any chance?

ukrit-himakoon commented 9 years ago

Hello,

We're working into this.

Will update you once it's available.

On Fri, Aug 21, 2015 at 9:58 PM, ihateselectingusernames < notifications@github.com> wrote:

Will there be a Windows (x86 + Python2.7) release for latest version by any chance?

— Reply to this email directly or view it on GitHub https://github.com/devcartel/api/issues/13#issuecomment-133453391.

ukrit-himakoon commented 9 years ago

Hello,

I would like to inform you that we have released RFA7.6.1.3 which supports windows 32 bit today. We have fixed most of the memory leak issue for you.

Please noted that since PyRFA8.0.0 there's an update which simplifies the output data so now the message exposes from dispatchEventQueue will be the dictionary as in the example below, you need to update your source code to support this data format as well.

p.marketPriceRequest('EUR=')
p.dispatchEventQueue()
{'MTYPE':'REFRESH','RIC':'EUR=','SERVICE':'IDN_RDF_SDS'}
{'MTYPE':'IMAGE','RIC':'EUR=','SERVICE':'IDN_RDF_SDS','ASK':1.3712,'BID':1.3709,...}

Please visit our download page below:

http://devcartel.com/pyrfa

Best regards, Ukrit

wiwat-tharateeraparb commented 9 years ago

Since version 8.0.0, Thomson Reuters decided to drop support for Win32 and RHEL5. So we will be maintaining 7.6.1 for Win32 and RHEL5 instead. Any bug fixes or enhancement in 8.0.0 series will be back ported to 7.6.1 as well. Having said that, there are some features that you can do with 8.0.0 but not with 7.6.1 e.g. Service Group failover which is fixed in 8.0.0.

ghost commented 9 years ago

Thanks a lot guys. I can live with the functionalities of 7.6 for now. I haven't had time to test it yet. I'll let you know my feedback soon.