7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis

Track allocated bytes in Thread's, update on TLAB retirement and direct allocation in Eden and tenured, add JNI methods for ThreadMXBean.

Reviewed-by: coleenp, kvn, dholmes, ysr
This commit is contained in:
Paul Hohensee 2011-01-07 10:42:32 -05:00
parent 6f2c2c3272
commit 7b0134a7cb
26 changed files with 447 additions and 212 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -53,10 +53,10 @@ inline Thread* ThreadLocalStorage::thread() {
uintptr_t raw = pd_raw_thread_id();
int ix = pd_cache_index(raw);
Thread *Candidate = ThreadLocalStorage::_get_thread_cache[ix];
if (Candidate->_self_raw_id == raw) {
Thread* candidate = ThreadLocalStorage::_get_thread_cache[ix];
if (candidate->self_raw_id() == raw) {
// hit
return Candidate;
return candidate;
} else {
return ThreadLocalStorage::get_thread_via_cache_slowly(raw, ix);
}