Issue Details (XML | Word | Printable)

Key: RVM-407
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Steve Blackburn
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
RVM

Is VM.disableGC() deprecated?

Created: 17/Mar/08 06:00 AM   Updated: 10/Oct/08 08:36 PM
Component/s: Runtime: Threads and Concurrency
Affects Version/s: None
Fix Version/s: 3.0.2

Time Tracking:
Not Specified


 Description  « Hide
I think VM.disableGC() exists only to deal with the possibility of the GC moving stacks from under one's feet while working on a stack.

Since I believe we no longer support gc-movable stacks, it should be deprecated.

Is it true that gc-movable stacks are no longer supported? If so, we should expunge code that depends on or is due to this. VM.disableGC() seems to be an example of this.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
David Grove added a comment - 21/Mar/08 10:39 AM
I believe we can eliminate support for the GC moving stacks. There may be other places where we use VM.disableGC in the code base to protect address manipulation, so it might not be possible to eliminate the API entirely.

It seems reasonable to me to decide that only the thread itself will ever move its stack (ie, stack growth due to stack overflow). I'm actually tempted to remove support for this as well, because as soon as you have 1 native frame on the stack, you can't relocate the stack to grow it. As a result, we just run with fairly big stacks all the time anyways (first time a native method is called, the stack is grown the be quite large), so it seems more sensible (and definitely simpler) to declare that we have a command line argument to allow the user to specify initial stack size, by default stacks start fairly large, and if you get a stackoverflow exception, we just give you the exception (do not attempt to grow stack).

The whole grow-the-stack on overflow model assumes that most thread stacks will be small by default, which was true before we implemented JNI, but hasn't really been true since 2002 (+/-). The stackgrowth code is really a remnant of the early m-n threading with no native code beginnings of the project. I personally don't think it is worth preserving this (basically unused & therefore untested) capability.


Steve Blackburn added a comment - 24/Mar/08 06:33 AM
I agree.

Daniel did an informal audit the other day, and I think he reckoned that VM.disableGC only existed for this.

Unless there's a strong reason to keep it, we should expunge it, as it causes us to do acrobatics in other areas (as Ian discovered), and as it happens, this is sometimes for no real gain.


Ian Rogers added a comment - 06/Apr/08 01:26 PM
There are uses in the JNI functions, in particular the critical variants.

David Grove added a comment - 10/Oct/08 08:36 PM
Less than 1 week to 3.0.1; pushing off more items to 3.0.2. Move back if you disagree and/or have time to tackle the issue.