comparison src/share/vm/memory/threadLocalAllocBuffer.cpp @ 2100:b1a2afa37ec4

7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis Summary: 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
author phh
date Fri, 07 Jan 2011 10:42:32 -0500
parents f95d63e2154a
children f08d439fab8c
comparison
equal deleted inserted replaced
2097:039eb4201e06 2100:b1a2afa37ec4
1 /* 1 /*
2 * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
112 // Waste accounting should be done in caller as appropriate; see, 112 // Waste accounting should be done in caller as appropriate; see,
113 // for example, clear_before_allocation(). 113 // for example, clear_before_allocation().
114 void ThreadLocalAllocBuffer::make_parsable(bool retire) { 114 void ThreadLocalAllocBuffer::make_parsable(bool retire) {
115 if (end() != NULL) { 115 if (end() != NULL) {
116 invariants(); 116 invariants();
117
118 if (retire) {
119 myThread()->incr_allocated_bytes(used_bytes());
120 }
121
117 CollectedHeap::fill_with_object(top(), hard_end(), retire); 122 CollectedHeap::fill_with_object(top(), hard_end(), retire);
118 123
119 if (retire || ZeroTLAB) { // "Reset" the TLAB 124 if (retire || ZeroTLAB) { // "Reset" the TLAB
120 set_start(NULL); 125 set_start(NULL);
121 set_top(NULL); 126 set_top(NULL);