1.1 --- a/src/share/vm/services/memBaseline.cpp Mon Nov 05 13:55:31 2012 -0800 1.2 +++ b/src/share/vm/services/memBaseline.cpp Fri Nov 09 19:24:31 2012 -0500 1.3 @@ -115,17 +115,25 @@ 1.4 while (malloc_ptr != NULL) { 1.5 index = flag2index(FLAGS_TO_MEMORY_TYPE(malloc_ptr->flags())); 1.6 size_t size = malloc_ptr->size(); 1.7 - _total_malloced += size; 1.8 - _malloc_data[index].inc(size); 1.9 - if (MemPointerRecord::is_arena_record(malloc_ptr->flags())) { 1.10 - // see if arena size record present 1.11 - MemPointerRecord* next_malloc_ptr = (MemPointerRecordEx*)malloc_itr.peek_next(); 1.12 - if (MemPointerRecord::is_arena_size_record(next_malloc_ptr->flags())) { 1.13 - assert(next_malloc_ptr->is_size_record_of_arena(malloc_ptr), "arena records do not match"); 1.14 - size = next_malloc_ptr->size(); 1.15 - _arena_data[index].inc(size); 1.16 - used_arena_size += size; 1.17 - malloc_itr.next(); 1.18 + if (malloc_ptr->is_arena_memory_record()) { 1.19 + // We do have anonymous arenas, they are either used as value objects, 1.20 + // which are embedded inside other objects, or used as stack objects. 1.21 + _arena_data[index].inc(size); 1.22 + used_arena_size += size; 1.23 + } else { 1.24 + _total_malloced += size; 1.25 + _malloc_data[index].inc(size); 1.26 + if (malloc_ptr->is_arena_record()) { 1.27 + // see if arena memory record present 1.28 + MemPointerRecord* next_malloc_ptr = (MemPointerRecordEx*)malloc_itr.peek_next(); 1.29 + if (next_malloc_ptr->is_arena_memory_record()) { 1.30 + assert(next_malloc_ptr->is_memory_record_of_arena(malloc_ptr), 1.31 + "Arena records do not match"); 1.32 + size = next_malloc_ptr->size(); 1.33 + _arena_data[index].inc(size); 1.34 + used_arena_size += size; 1.35 + malloc_itr.next(); 1.36 + } 1.37 } 1.38 } 1.39 malloc_ptr = (MemPointerRecordEx*)malloc_itr.next(); 1.40 @@ -193,7 +201,7 @@ 1.41 1.42 // baseline memory that is totaled over 1 KB 1.43 while (malloc_ptr != NULL) { 1.44 - if (!MemPointerRecord::is_arena_size_record(malloc_ptr->flags())) { 1.45 + if (!MemPointerRecord::is_arena_memory_record(malloc_ptr->flags())) { 1.46 // skip thread stacks 1.47 if (!IS_MEMORY_TYPE(malloc_ptr->flags(), mtThreadStack)) { 1.48 if (malloc_callsite.addr() != malloc_ptr->pc()) {