← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #241887]: Find out how much memory is being used by an object

 

Question #241887 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/241887

    Status: Open => Answered

RaiMan proposed the following answer:
since we are in Jython context, you might use any Java features.
Besides del, there is no other possibility, to trigger GC in Jython.

del mylist[0:len(mylist)] should make a del to each element in myList.
Elements, that then have a reference count of 0 are eligible for garbage
collection (but with todays Java, you cannot really influence, when GC
does its job).

So to make things eligible for garbage collection, you must be sure,
that the ref count for an object is 0 (in your case this might not be
depending how the list elements where created).

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.