[omniORB] omniorbpy: switching GC off for duration of every outgoing call

Duncan Grisby duncan at grisby.org
Fri Jan 16 15:07:50 GMT 2015


On Mon, 2015-01-12 at 23:48 -0600, Michael Kilburn wrote:


> I noticed that if call returns a large structure (like thousands of
> items) it makes sense to switch python garbage collection off -- it's
> only purpose is to find and kill objects that are alive only because
> they are in 'reference loop' with other similar objects (and it does
> check 1-st generation of objects quite often -- like every 700
> allocations/deallocations). But when omniOrbPy converts returned
> values into python objects -- it is guaranteed to not create any
> cycles.

If you're using valuetypes, omniORBpy can in fact create cycles, but I
guess you're probably not doing that...

[...]
> Is there any easy way in omniOrbPy to automatically switch gc off in
> every outgoing call? (and then switch it back once all data is
> received and converted to python objects)

You could register clientSendRequest and clientReceiveReply interceptors
to disable and then re-enable the GC. Beware that if your code is
multi-threaded, the GC is a global option, so your threads could tread
on each other.

Duncan.

-- 
 -- Duncan Grisby         --
  -- duncan at grisby.org     --
   -- http://www.grisby.org --





More information about the omniORB-list mailing list