Mercurial > hg > graal-compiler
comparison src/share/vm/services/memBaseline.cpp @ 6981:8c413497f434
Merge
author | zgu |
---|---|
date | Fri, 09 Nov 2012 22:22:53 -0800 |
parents | fb3190e77d3c |
children | ecd24264898b |
comparison
equal
deleted
inserted
replaced
6978:4efcd79826f2 | 6981:8c413497f434 |
---|---|
113 size_t used_arena_size = 0; | 113 size_t used_arena_size = 0; |
114 int index; | 114 int index; |
115 while (malloc_ptr != NULL) { | 115 while (malloc_ptr != NULL) { |
116 index = flag2index(FLAGS_TO_MEMORY_TYPE(malloc_ptr->flags())); | 116 index = flag2index(FLAGS_TO_MEMORY_TYPE(malloc_ptr->flags())); |
117 size_t size = malloc_ptr->size(); | 117 size_t size = malloc_ptr->size(); |
118 _total_malloced += size; | 118 if (malloc_ptr->is_arena_memory_record()) { |
119 _malloc_data[index].inc(size); | 119 // We do have anonymous arenas, they are either used as value objects, |
120 if (MemPointerRecord::is_arena_record(malloc_ptr->flags())) { | 120 // which are embedded inside other objects, or used as stack objects. |
121 // see if arena size record present | 121 _arena_data[index].inc(size); |
122 MemPointerRecord* next_malloc_ptr = (MemPointerRecordEx*)malloc_itr.peek_next(); | 122 used_arena_size += size; |
123 if (MemPointerRecord::is_arena_size_record(next_malloc_ptr->flags())) { | 123 } else { |
124 assert(next_malloc_ptr->is_size_record_of_arena(malloc_ptr), "arena records do not match"); | 124 _total_malloced += size; |
125 size = next_malloc_ptr->size(); | 125 _malloc_data[index].inc(size); |
126 _arena_data[index].inc(size); | 126 if (malloc_ptr->is_arena_record()) { |
127 used_arena_size += size; | 127 // see if arena memory record present |
128 malloc_itr.next(); | 128 MemPointerRecord* next_malloc_ptr = (MemPointerRecordEx*)malloc_itr.peek_next(); |
129 if (next_malloc_ptr->is_arena_memory_record()) { | |
130 assert(next_malloc_ptr->is_memory_record_of_arena(malloc_ptr), | |
131 "Arena records do not match"); | |
132 size = next_malloc_ptr->size(); | |
133 _arena_data[index].inc(size); | |
134 used_arena_size += size; | |
135 malloc_itr.next(); | |
136 } | |
129 } | 137 } |
130 } | 138 } |
131 malloc_ptr = (MemPointerRecordEx*)malloc_itr.next(); | 139 malloc_ptr = (MemPointerRecordEx*)malloc_itr.next(); |
132 } | 140 } |
133 | 141 |
191 malloc_data->sort((FN_SORT)malloc_sort_by_pc); | 199 malloc_data->sort((FN_SORT)malloc_sort_by_pc); |
192 bool ret = true; | 200 bool ret = true; |
193 | 201 |
194 // baseline memory that is totaled over 1 KB | 202 // baseline memory that is totaled over 1 KB |
195 while (malloc_ptr != NULL) { | 203 while (malloc_ptr != NULL) { |
196 if (!MemPointerRecord::is_arena_size_record(malloc_ptr->flags())) { | 204 if (!MemPointerRecord::is_arena_memory_record(malloc_ptr->flags())) { |
197 // skip thread stacks | 205 // skip thread stacks |
198 if (!IS_MEMORY_TYPE(malloc_ptr->flags(), mtThreadStack)) { | 206 if (!IS_MEMORY_TYPE(malloc_ptr->flags(), mtThreadStack)) { |
199 if (malloc_callsite.addr() != malloc_ptr->pc()) { | 207 if (malloc_callsite.addr() != malloc_ptr->pc()) { |
200 if ((malloc_callsite.amount()/K) > 0) { | 208 if ((malloc_callsite.amount()/K) > 0) { |
201 if (!_malloc_cs->append(&malloc_callsite)) { | 209 if (!_malloc_cs->append(&malloc_callsite)) { |