Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Needs to force more GC work #1

Closed
Gerry1135 opened this issue Sep 9, 2014 · 1 comment
Closed

Needs to force more GC work #1

Gerry1135 opened this issue Sep 9, 2014 · 1 comment

Comments

@Gerry1135
Copy link
Owner

At present the objects being allocated do not contain any object references and such objects may well be handled specially by the GC, e.g. the contents of the object don't need to be checked to mark other objects as reachable.

Modify the Dummy class to include references to other objects to avoid this optimisation. Start with a simple object reference and test effect. If necessary, also try a more complex, reference using data structure such as a linked list or tree.

@Gerry1135
Copy link
Owner Author

Version 0.2.0.0 (4e115c2) changes how things work. The slider still sets the number of objects allocated on each call to Update but, instead of the objects being put in a single list and freed on the next call, it now has an array of 10 lists and places each allocated object in a random one. Every second (tested in Update using a timer) the lists in the array are shifted down one place causing the first list to be freed and a new list is created at the end of the array. This results in (many of) the objects being kept around longer than one GC cycle so that, if the GC is generational, the work will be shifted out of the highly optimised nursery collection into the main collection.

Also, the Dummy object used now includes an object reference so that it isn't marked as a Non-Reference object (which are much quicker to collect).

The first change greatly reduces the CPU usage of the plugin while significantly increasing the amount of work the GC has to do and the second change also significantly increases the GC workload.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant