2008-06-05 15:57:56 -07:00
|
|
|
/*
|
2018-01-11 10:40:01 +01:00
|
|
|
* Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
|
2008-06-05 15:57:56 -07:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
|
|
*
|
|
|
|
* This code is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License version 2 only, as
|
|
|
|
* published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
|
|
* version 2 for more details (a copy is included in the LICENSE file that
|
|
|
|
* accompanied this code).
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License version
|
|
|
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
|
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*
|
2010-05-27 19:08:38 -07:00
|
|
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
|
|
* or visit www.oracle.com if you need additional information or have any
|
|
|
|
* questions.
|
2008-06-05 15:57:56 -07:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2015-05-13 15:16:06 +02:00
|
|
|
#ifndef SHARE_VM_GC_G1_VM_OPERATIONS_G1_HPP
|
|
|
|
#define SHARE_VM_GC_G1_VM_OPERATIONS_G1_HPP
|
2010-11-23 13:22:55 -08:00
|
|
|
|
2015-09-30 09:07:21 +02:00
|
|
|
#include "gc/shared/gcId.hpp"
|
2015-05-13 15:16:06 +02:00
|
|
|
#include "gc/shared/vmGCOperations.hpp"
|
2010-11-23 13:22:55 -08:00
|
|
|
|
2008-06-05 15:57:56 -07:00
|
|
|
// VM_operations for the G1 collector.
|
|
|
|
// VM_GC_Operation:
|
|
|
|
// - VM_CGC_Operation
|
2018-01-11 10:40:01 +01:00
|
|
|
// - VM_G1CollectForAllocation
|
2008-06-05 15:57:56 -07:00
|
|
|
// - VM_G1CollectFull
|
|
|
|
|
|
|
|
class VM_G1CollectFull: public VM_GC_Operation {
|
2010-08-24 17:24:33 -04:00
|
|
|
public:
|
2015-02-13 09:48:49 +01:00
|
|
|
VM_G1CollectFull(uint gc_count_before,
|
|
|
|
uint full_gc_count_before,
|
2010-06-28 14:13:17 -04:00
|
|
|
GCCause::Cause cause)
|
2014-10-20 10:18:17 +02:00
|
|
|
: VM_GC_Operation(gc_count_before, cause, full_gc_count_before, true) { }
|
2008-06-05 15:57:56 -07:00
|
|
|
virtual VMOp_Type type() const { return VMOp_G1CollectFull; }
|
|
|
|
virtual void doit();
|
|
|
|
virtual const char* name() const {
|
2018-01-11 10:40:01 +01:00
|
|
|
return "G1 Full collection";
|
2008-06-05 15:57:56 -07:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2018-01-11 10:40:01 +01:00
|
|
|
class VM_G1CollectForAllocation: public VM_CollectForAllocation {
|
2010-06-28 14:13:17 -04:00
|
|
|
private:
|
2018-01-11 10:40:01 +01:00
|
|
|
bool _pause_succeeded;
|
|
|
|
|
2010-08-24 17:24:33 -04:00
|
|
|
bool _should_initiate_conc_mark;
|
2012-03-12 14:59:00 -07:00
|
|
|
bool _should_retry_gc;
|
2010-08-24 17:24:33 -04:00
|
|
|
double _target_pause_time_ms;
|
2015-02-13 09:48:49 +01:00
|
|
|
uint _old_marking_cycles_completed_before;
|
2010-06-28 14:13:17 -04:00
|
|
|
public:
|
2018-01-11 10:40:01 +01:00
|
|
|
VM_G1CollectForAllocation(size_t word_size,
|
|
|
|
uint gc_count_before,
|
|
|
|
GCCause::Cause gc_cause,
|
|
|
|
bool should_initiate_conc_mark,
|
2018-03-02 10:09:08 +01:00
|
|
|
double target_pause_time_ms);
|
2018-01-11 10:40:01 +01:00
|
|
|
virtual VMOp_Type type() const { return VMOp_G1CollectForAllocation; }
|
2012-03-12 14:59:00 -07:00
|
|
|
virtual bool doit_prologue();
|
2008-06-05 15:57:56 -07:00
|
|
|
virtual void doit();
|
2010-06-28 14:13:17 -04:00
|
|
|
virtual void doit_epilogue();
|
2008-06-05 15:57:56 -07:00
|
|
|
virtual const char* name() const {
|
2018-01-11 10:40:01 +01:00
|
|
|
return "G1 collect for allocation";
|
2008-06-05 15:57:56 -07:00
|
|
|
}
|
2012-03-12 14:59:00 -07:00
|
|
|
bool should_retry_gc() const { return _should_retry_gc; }
|
2018-01-11 10:40:01 +01:00
|
|
|
bool pause_succeeded() { return _pause_succeeded; }
|
2008-06-05 15:57:56 -07:00
|
|
|
};
|
|
|
|
|
2011-10-20 12:06:20 -07:00
|
|
|
// Concurrent GC stop-the-world operations such as remark and cleanup;
|
2008-06-05 15:57:56 -07:00
|
|
|
// consider sharing these with CMS's counterparts.
|
|
|
|
class VM_CGC_Operation: public VM_Operation {
|
2016-08-30 23:48:16 -04:00
|
|
|
VoidClosure* _cl;
|
|
|
|
const char* _printGCMessage;
|
|
|
|
uint _gc_id;
|
2011-10-20 12:06:20 -07:00
|
|
|
|
2010-08-24 17:24:33 -04:00
|
|
|
public:
|
2016-08-30 23:48:16 -04:00
|
|
|
VM_CGC_Operation(VoidClosure* cl, const char *printGCMsg)
|
|
|
|
: _cl(cl), _printGCMessage(printGCMsg), _gc_id(GCId::current()) {}
|
2008-06-05 15:57:56 -07:00
|
|
|
virtual VMOp_Type type() const { return VMOp_CGC_Operation; }
|
|
|
|
virtual void doit();
|
|
|
|
virtual bool doit_prologue();
|
|
|
|
virtual void doit_epilogue();
|
|
|
|
virtual const char* name() const {
|
|
|
|
return "concurrent gc";
|
|
|
|
}
|
|
|
|
};
|
2010-11-23 13:22:55 -08:00
|
|
|
|
2015-05-13 15:16:06 +02:00
|
|
|
#endif // SHARE_VM_GC_G1_VM_OPERATIONS_G1_HPP
|