Does {MEMORY}.collection_off reset the progress of the garbage collector?

29 views
Skip to first unread message

jjj

unread,
Nov 18, 2015, 4:14:01 PM11/18/15
to Eiffel Users
I'm pretty sure the garbage collector is "incremental"...

Does turning the collector off & on with {MEMORY}.collection_off & {MEMORY}.collection_on reset the state of the collector?  In other words, does the collector have to start over?

Thanks,
jjj

jjj

unread,
Dec 2, 2015, 6:40:41 PM12/2/15
to Eiffel Users
bump ?

Emmanuel Stapf

unread,
Dec 6, 2015, 8:06:08 AM12/6/15
to eiffel...@googlegroups.com

Hi,

 

It depends what you mean by `start over’. When you trigger manually a GC cycle, we update some statistics that are used internally to find out when to launch the next GC cycle.

 

Manu

 

--
You received this message because you are subscribed to the Google Groups "Eiffel Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eiffel-users...@googlegroups.com.
To post to this group, send email to eiffel...@googlegroups.com.
Visit this group at http://groups.google.com/group/eiffel-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/eiffel-users/d8d4e9d5-cfcb-4980-b925-4d7c6345a01b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

jjj

unread,
Dec 6, 2015, 12:20:55 PM12/6/15
to Eiffel Users, ma...@eiffel.com
More specifically.  In REFLECTED_OBJECT.object_address there is a note that says "no_gc".  In an answer to a previous question you said, "This is an annotation to say that calling object_address is only safe when you are sure no 
GC will take place. It is merely informational. "  So, I assume, if I need to call `object_address' I must first call MEMORY.collection_off, do my work with `object_address', then call MEMORY.collection_on.

Does the GC have to redo any of the [incremental] work when turned off and then back on?  Is there a time cost for turning off and back on?

Emmanuel Stapf

unread,
Dec 7, 2015, 8:20:02 AM12/7/15
to Eiffel Users

As I said there is no work in between GC cycles, just some internal update on memory statistics. Disabling the GC means that most likely the GC cycle will occur soon after enabling it again. The operation of enabling/disabling the GC is equivalent to updating a field, so you could say it has no user visible cost.

 

Manu

jjj

unread,
Dec 7, 2015, 10:54:58 AM12/7/15
to Eiffel Users, ma...@eiffel.com
Thanks, that was what I was looking for.



Reply all
Reply to author
Forward
0 new messages