Dynamic Global Cleanup/Orphaned Globals
Was wondering if anyone had a Dynamic way to see if a Global is still being used by a Class File.
We have been monitoring our Global Size recently, and I am trying to find problematic Class files that are not being cleaned up or used appropriately. I have come across some globals that do not seem to have a Class attached to them anymore, and instead of deleting globals 1 by 1, I was looking for a way that we could dynamically do this since the globals have data that is stale in them.
Thanks
Scott
Comments
Are you sure they were ever used for a class that no longer exists?
If I search in VSCode using the global name, nothing is returned. So, either the Class file was recompiled to a new global, or no longer in the system.
These globals were created as part of %Persistent Data Classes that did not use Ens.Request or Ens.Response.
There are several hurdles to consider:
- Scanning compiled class storage just shows definitions
- Journals show active changed globals
- I see no way for static globals that are written once, but just referenced without changes
- Finally, globals might also be used without any class around
- On top: cross namespace references for classes and globals might apply as well
Quite a can of worms.
If I don't see the Global associated with a Class, it doesn't seem to be getting cleaned up within the Daily Purge. So how do we clean these up in some cases?