Skip to content
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/hotspot/os/aix/os_aix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
#include "runtime/perfMemory.hpp"
#include "runtime/safefetch.hpp"
#include "runtime/sharedRuntime.hpp"
#include "runtime/statSampler.hpp"
#include "runtime/threadCritical.hpp"
#include "runtime/threads.hpp"
#include "runtime/timer.hpp"
Expand Down
1 change: 0 additions & 1 deletion src/hotspot/os/bsd/os_bsd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
#include "runtime/perfMemory.hpp"
#include "runtime/semaphore.hpp"
#include "runtime/sharedRuntime.hpp"
#include "runtime/statSampler.hpp"
#include "runtime/stubRoutines.hpp"
#include "runtime/threadCritical.hpp"
#include "runtime/threads.hpp"
Expand Down
1 change: 0 additions & 1 deletion src/hotspot/os/linux/os_linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
#include "runtime/osThread.hpp"
#include "runtime/perfMemory.hpp"
#include "runtime/sharedRuntime.hpp"
#include "runtime/statSampler.hpp"
#include "runtime/stubRoutines.hpp"
#include "runtime/threadCritical.hpp"
#include "runtime/threads.hpp"
Expand Down
1 change: 0 additions & 1 deletion src/hotspot/os/windows/os_windows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
#include "runtime/safepointMechanism.hpp"
#include "runtime/semaphore.inline.hpp"
#include "runtime/sharedRuntime.hpp"
#include "runtime/statSampler.hpp"
#include "runtime/stubRoutines.hpp"
#include "runtime/suspendedThreadTask.hpp"
#include "runtime/threadCritical.hpp"
Expand Down
23 changes: 3 additions & 20 deletions src/hotspot/share/gc/parallel/spaceCounters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@

SpaceCounters::SpaceCounters(const char* name, int ordinal, size_t max_size,
MutableSpace* m, GenerationCounters* gc)
: _last_used_in_bytes(0), _object_space(m)
{
: _object_space(m) {
if (UsePerfData) {
EXCEPTION_MARK;
ResourceMark rm;
Expand All @@ -60,7 +59,7 @@ SpaceCounters::SpaceCounters(const char* name, int ordinal, size_t max_size,

cname = PerfDataManager::counter_name(_name_space, "used");
_used = PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Bytes,
new UsedHelper(this),
_object_space->used_in_bytes(),
CHECK);

cname = PerfDataManager::counter_name(_name_space, "initCapacity");
Expand All @@ -74,21 +73,5 @@ SpaceCounters::~SpaceCounters() {
}

void SpaceCounters::update_used() {
size_t new_used = _object_space->used_in_bytes();
Atomic::store(&_last_used_in_bytes, new_used);
_used->set_value(new_used);
}

jlong SpaceCounters::UsedHelper::take_sample() {
// Sampling may occur during GC, possibly while GC is updating the space.
// The space can be in an inconsistent state during such an update. We
// don't want to block sampling for the duration of a GC. Instead, skip
// sampling in that case, using the last recorded value.
assert(!Heap_lock->owned_by_self(), "precondition");
if (Heap_lock->try_lock()) {
size_t new_used = _counters->_object_space->used_in_bytes();
Atomic::store(&_counters->_last_used_in_bytes, new_used);
Heap_lock->unlock();
}
return Atomic::load(&_counters->_last_used_in_bytes);
_used->set_value(_object_space->used_in_bytes());
}
13 changes: 0 additions & 13 deletions src/hotspot/share/gc/parallel/spaceCounters.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ class SpaceCounters: public CHeapObj<mtGC> {
private:
PerfVariable* _capacity;
PerfVariable* _used;
volatile size_t _last_used_in_bytes;

// Constant PerfData types don't need to retain a reference.
// However, it's a good idea to document them here.
Expand All @@ -48,8 +47,6 @@ class SpaceCounters: public CHeapObj<mtGC> {
MutableSpace* _object_space;
char* _name_space;

class UsedHelper;

public:

SpaceCounters(const char* name, int ordinal, size_t max_size,
Expand All @@ -71,14 +68,4 @@ class SpaceCounters: public CHeapObj<mtGC> {
const char* name_space() const { return _name_space; }
};

class SpaceCounters::UsedHelper: public PerfLongSampleHelper {
private:
SpaceCounters* _counters;

public:
UsedHelper(SpaceCounters* counters) : _counters(counters) { }

jlong take_sample() override;
};

#endif // SHARE_GC_PARALLEL_SPACECOUNTERS_HPP
23 changes: 3 additions & 20 deletions src/hotspot/share/gc/serial/cSpaceCounters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@

CSpaceCounters::CSpaceCounters(const char* name, int ordinal, size_t max_size,
ContiguousSpace* s, GenerationCounters* gc)
: _last_used_in_bytes(0), _space(s)
{
: _space(s) {
if (UsePerfData) {
EXCEPTION_MARK;
ResourceMark rm;
Expand Down Expand Up @@ -57,7 +56,7 @@ CSpaceCounters::CSpaceCounters(const char* name, int ordinal, size_t max_size,

cname = PerfDataManager::counter_name(_name_space, "used");
_used = PerfDataManager::create_variable(SUN_GC, cname, PerfData::U_Bytes,
new UsedHelper(this),
_space->used(),
CHECK);

cname = PerfDataManager::counter_name(_name_space, "initCapacity");
Expand All @@ -75,26 +74,10 @@ void CSpaceCounters::update_capacity() {
}

void CSpaceCounters::update_used() {
size_t new_used = _space->used();
Atomic::store(&_last_used_in_bytes, new_used);
_used->set_value(new_used);
_used->set_value(_space->used());
}

void CSpaceCounters::update_all() {
update_used();
update_capacity();
}

jlong CSpaceCounters::UsedHelper::take_sample(){
// Sampling may occur during GC, possibly while GC is updating the space.
// The space can be in an inconsistent state during such an update. We
// don't want to block sampling for the duration of a GC. Instead, skip
// sampling in that case, using the last recorded value.
assert(!Heap_lock->owned_by_self(), "precondition");
if (Heap_lock->try_lock()) {
size_t new_used = _counters->_space->used();
Atomic::store(&_counters->_last_used_in_bytes, new_used);
Heap_lock->unlock();
}
return Atomic::load(&_counters->_last_used_in_bytes);
}
13 changes: 0 additions & 13 deletions src/hotspot/share/gc/serial/cSpaceCounters.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ class CSpaceCounters: public CHeapObj<mtGC> {
PerfVariable* _capacity;
PerfVariable* _used;
PerfVariable* _max_capacity;
volatile size_t _last_used_in_bytes;

// Constant PerfData types don't need to retain a reference.
// However, it's a good idea to document them here.
Expand All @@ -48,8 +47,6 @@ class CSpaceCounters: public CHeapObj<mtGC> {
ContiguousSpace* _space;
char* _name_space;

class UsedHelper;

public:

CSpaceCounters(const char* name, int ordinal, size_t max_size,
Expand All @@ -64,14 +61,4 @@ class CSpaceCounters: public CHeapObj<mtGC> {
const char* name_space() const { return _name_space; }
};

class CSpaceCounters::UsedHelper : public PerfLongSampleHelper {
private:
CSpaceCounters* _counters;

public:
UsedHelper(CSpaceCounters* counters) : _counters(counters) { }

jlong take_sample() override;
};

#endif // SHARE_GC_SERIAL_CSPACECOUNTERS_HPP
1 change: 1 addition & 0 deletions src/hotspot/share/runtime/arguments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,7 @@ static SpecialFlag const special_jvm_flags[] = {

// -------------- Obsolete Flags - sorted by expired_in --------------

{ "PerfDataSamplingInterval", JDK_Version::undefined(), JDK_Version::jdk(25), JDK_Version::jdk(26) },
{ "MetaspaceReclaimPolicy", JDK_Version::undefined(), JDK_Version::jdk(21), JDK_Version::undefined() },
{ "ZGenerational", JDK_Version::jdk(23), JDK_Version::jdk(24), JDK_Version::undefined() },
{ "ZMarkStackSpaceLimit", JDK_Version::undefined(), JDK_Version::jdk(25), JDK_Version::undefined() },
Expand Down
5 changes: 0 additions & 5 deletions src/hotspot/share/runtime/globals.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1720,11 +1720,6 @@ const int ObjectAlignmentInBytes = 8;
"The string %p in the file name (if present) " \
"will be replaced by pid") \
\
product(int, PerfDataSamplingInterval, 50, \
"Data sampling interval (in milliseconds)") \
range(PeriodicTask::min_interval, max_jint) \
constraint(PerfDataSamplingIntervalFunc, AfterErgo) \
\
product(bool, PerfDisableSharedMem, false, \
"Store performance data in standard memory") \
\
Expand Down
5 changes: 0 additions & 5 deletions src/hotspot/share/runtime/java.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@
#include "runtime/java.hpp"
#include "runtime/javaThread.hpp"
#include "runtime/sharedRuntime.hpp"
#include "runtime/statSampler.hpp"
#include "runtime/stubRoutines.hpp"
#include "runtime/task.hpp"
#include "runtime/threads.hpp"
Expand Down Expand Up @@ -463,10 +462,6 @@ void before_exit(JavaThread* thread, bool halt) {
// PeriodicTasks to reduce the likelihood of races.
WatcherThread::stop();

// shut down the StatSampler task
StatSampler::disengage();
StatSampler::destroy();

NativeHeapTrimmer::cleanup();

// Stop concurrent GC threads
Expand Down
Loading