Mercurial > hg > truffle
comparison src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp @ 2188:c33825b68624
6923430: G1: assert(res != 0,"This should have worked.")
7007446: G1: expand the heap with a single step, not one region at a time
Summary: Changed G1CollectedHeap::expand() to expand the committed space by calling VirtualSpace::expand_by() once rather than for every region in the expansion amount. This allows the success or failure of the expansion to be determined before creating any heap regions. Introduced a develop flag G1ExitOnExpansionFailure (false by default) that, when true, will exit the VM if the expansion of the committed space fails. Finally G1CollectedHeap::expand() returns a status back to it's caller so that the caller knows whether to attempt the allocation.
Reviewed-by: brutisso, tonyp
author | johnc |
---|---|
date | Wed, 02 Feb 2011 10:41:20 -0800 |
parents | 97ba643ea3ed |
children | 4e0069ff33df |
comparison
equal
deleted
inserted
replaced
2187:986b2844f7a2 | 2188:c33825b68624 |
---|---|
617 // allocated block, or else "NULL". | 617 // allocated block, or else "NULL". |
618 HeapWord* expand_and_allocate(size_t word_size); | 618 HeapWord* expand_and_allocate(size_t word_size); |
619 | 619 |
620 public: | 620 public: |
621 // Expand the garbage-first heap by at least the given size (in bytes!). | 621 // Expand the garbage-first heap by at least the given size (in bytes!). |
622 // Returns true if the heap was expanded by the requested amount; | |
623 // false otherwise. | |
622 // (Rounds up to a HeapRegion boundary.) | 624 // (Rounds up to a HeapRegion boundary.) |
623 virtual void expand(size_t expand_bytes); | 625 bool expand(size_t expand_bytes); |
624 | 626 |
625 // Do anything common to GC's. | 627 // Do anything common to GC's. |
626 virtual void gc_prologue(bool full); | 628 virtual void gc_prologue(bool full); |
627 virtual void gc_epilogue(bool full); | 629 virtual void gc_epilogue(bool full); |
628 | 630 |
979 G1BlockOffsetSharedArray* bot_shared() const { return _bot_shared; } | 981 G1BlockOffsetSharedArray* bot_shared() const { return _bot_shared; } |
980 | 982 |
981 // Reference Processing accessor | 983 // Reference Processing accessor |
982 ReferenceProcessor* ref_processor() { return _ref_processor; } | 984 ReferenceProcessor* ref_processor() { return _ref_processor; } |
983 | 985 |
984 // Reserved (g1 only; super method includes perm), capacity and the used | |
985 // portion in bytes. | |
986 size_t g1_reserved_obj_bytes() const { return _g1_reserved.byte_size(); } | |
987 virtual size_t capacity() const; | 986 virtual size_t capacity() const; |
988 virtual size_t used() const; | 987 virtual size_t used() const; |
989 // This should be called when we're not holding the heap lock. The | 988 // This should be called when we're not holding the heap lock. The |
990 // result might be a bit inaccurate. | 989 // result might be a bit inaccurate. |
991 size_t used_unlocked() const; | 990 size_t used_unlocked() const; |