Repeated/general use of engine.Operations.GetMethod seems to leak/exhaust memory #1825
Unanswered
jamesalbert
asked this question in
Q&A
Replies: 1 comment
-
after looking back at this, I think setting method to null before returning the bool in HasMethod might have been a fix alone. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
hi all,
I've been integrating ironpython into my .net app for the past few days. Full transparency, I'm not super well versed in .net so I'll try to keep it short and leave open the possibility that I'm just doing something I shouldn't 🥲
For context, I'm working in a typical unity game environment where events get triggered asynchronously over time.
My .net app is designed to load a python script which defines a class. The app then instantiates the class, and invokes member functions of this object triggered by certain events over time.
I didn't notice this behavior until I started calling member functions every frame. I would call the methods like:
Doing it this way, I saw an continuous increase in memory at a rate of ~50 Mb/minute. Through trial and error (commenting out certain parts), I narrowed it down to
GetMember
. I started caching the result of that call and the problem seems to be resolved.My main question is: Am I doing this incorrectly? Is caching the result of
GetMember
a band-aid solution in the sense that I'm not addressing the real issue? Are there any profiling techniques recommended for measuring ironpython activity? I have prometheus/node-exporter setup where this is running, but I can only tell that memory exhaustion is happening, but not anything much more beyond that.Any help, tips, or advice is greatly appreciated
Beta Was this translation helpful? Give feedback.
All reactions