Is this normal when using Introspection? Objects sticking around...

I am not sure if this is intended behaviour or a memory leak/bug so before I report it, I just want some feedback.

When you use Introspection the introspection objects are still around, even when used in a local scope.

I placed the following code in a pushbutton;

call Introspection.GetType(self).Name

The object count goes from 24 to 35 after pressing this button even though there is no global variable storing the object details.

Note: Runtime.ObjectCount is not evaluated within the pushbutton.action event/

Test Project

  1. Press the Runtime Object Count
  2. Press the Introspection button
  3. Press the Runtime Object Count

Notice the object count goes from 24 to 35.

System Details

Mac OS X: 10.10.4
Xojo 2015r31
Running from the project and Cocoa built app
No plugins

When you use introspection, the framework keeps all type info objects in memory until you close the application. This caching is for performance reason. See case 26079 in Feedback.

A year ago I created the case 35899 (Introspection: Ability to clear the cache).

It doesn’t go beyond that so I’d chalk that up to an implementation detail.

I think it makes debugging difficult. One thing I try to do is to check the memory objects before quitting an application. If there is more than the App object and a few menu items, I have a problem somewhere. With thousands of introspection objects mixed in, this check is impossible. If one could at least hide the introspection objects temporarily in the debugger!

Thanks for the info. I agree though Eli, it would be great if we can clear or hide this information as it makes looking for memory issues much more difficult.