294 " desired_size: " SIZE_FORMAT "KB"
295 " slow allocs: %d refill waste: " SIZE_FORMAT "B"
296 " alloc:%8.5f %8.0fKB refills: %d waste %4.1f%% gc: %dB"
297 " slow: %dB fast: %dB",
298 tag, p2i(thrd), thrd->osthread()->thread_id(),
299 _desired_size / (K / HeapWordSize),
300 _slow_allocations, _refill_waste_limit * HeapWordSize,
301 _allocation_fraction.average(),
302 _allocation_fraction.average() * tlab_used / K,
303 _number_of_refills, waste_percent,
304 _gc_waste * HeapWordSize,
305 _slow_refill_waste * HeapWordSize,
306 _fast_refill_waste * HeapWordSize);
307 }
308
309 void ThreadLocalAllocBuffer::verify() {
310 HeapWord* p = start();
311 HeapWord* t = top();
312 HeapWord* prev_p = NULL;
313 while (p < t) {
314 oop(p)->verify();
315 prev_p = p;
316 p += oop(p)->size();
317 }
318 guarantee(p == top(), "end of last object must match end of space");
319 }
320
321 void ThreadLocalAllocBuffer::set_sample_end() {
322 size_t heap_words_remaining = pointer_delta(_end, _top);
323 size_t bytes_until_sample = myThread()->heap_sampler().bytes_until_sample();
324 size_t words_until_sample = bytes_until_sample / HeapWordSize;
325
326 if (heap_words_remaining > words_until_sample) {
327 HeapWord* new_end = _top + words_until_sample;
328 set_end(new_end);
329 _bytes_since_last_sample_point = bytes_until_sample;
330 } else {
331 _bytes_since_last_sample_point = heap_words_remaining * HeapWordSize;
332 }
333 }
334
|
294 " desired_size: " SIZE_FORMAT "KB"
295 " slow allocs: %d refill waste: " SIZE_FORMAT "B"
296 " alloc:%8.5f %8.0fKB refills: %d waste %4.1f%% gc: %dB"
297 " slow: %dB fast: %dB",
298 tag, p2i(thrd), thrd->osthread()->thread_id(),
299 _desired_size / (K / HeapWordSize),
300 _slow_allocations, _refill_waste_limit * HeapWordSize,
301 _allocation_fraction.average(),
302 _allocation_fraction.average() * tlab_used / K,
303 _number_of_refills, waste_percent,
304 _gc_waste * HeapWordSize,
305 _slow_refill_waste * HeapWordSize,
306 _fast_refill_waste * HeapWordSize);
307 }
308
309 void ThreadLocalAllocBuffer::verify() {
310 HeapWord* p = start();
311 HeapWord* t = top();
312 HeapWord* prev_p = NULL;
313 while (p < t) {
314 oopDesc::verify(oop(p));
315 prev_p = p;
316 p += oop(p)->size();
317 }
318 guarantee(p == top(), "end of last object must match end of space");
319 }
320
321 void ThreadLocalAllocBuffer::set_sample_end() {
322 size_t heap_words_remaining = pointer_delta(_end, _top);
323 size_t bytes_until_sample = myThread()->heap_sampler().bytes_until_sample();
324 size_t words_until_sample = bytes_until_sample / HeapWordSize;
325
326 if (heap_words_remaining > words_until_sample) {
327 HeapWord* new_end = _top + words_until_sample;
328 set_end(new_end);
329 _bytes_since_last_sample_point = bytes_until_sample;
330 } else {
331 _bytes_since_last_sample_point = heap_words_remaining * HeapWordSize;
332 }
333 }
334
|