174 }
175
176 static int col_width(julong n, const char *name) {
177 int w = julong_width(n);
178 int min = (int)(strlen(name));
179 if (w < min) {
180 w = min;
181 }
182 // add a leading space for separation.
183 return w + 1;
184 }
185
186 public:
187 KlassInfoHisto(KlassInfoTable* cit);
188 ~KlassInfoHisto();
189 void add(KlassInfoEntry* cie);
190 void print_histo_on(outputStream* st);
191 void sort();
192 };
193
194 #endif // INCLUDE_SERVICES
195
196 // These declarations are needed since the declaration of KlassInfoTable and
197 // KlassInfoClosure are guarded by #if INLCUDE_SERVICES
198 class KlassInfoTable;
199 class KlassInfoClosure;
200
201 class HeapInspection : public StackObj {
202 public:
203 void heap_inspection(outputStream* st, WorkerThreads* workers) NOT_SERVICES_RETURN;
204 uintx populate_table(KlassInfoTable* cit, BoolObjectClosure* filter, WorkerThreads* workers) NOT_SERVICES_RETURN_(0);
205 static void find_instances_at_safepoint(Klass* k, GrowableArray<oop>* result) NOT_SERVICES_RETURN;
206 };
207
208 // Parallel heap inspection task. Parallel inspection can fail due to
209 // a native OOM when allocating memory for TL-KlassInfoTable.
210 // _success will be set false on an OOM, and serial inspection tried.
211 class ParHeapInspectTask : public WorkerTask {
212 private:
213 ParallelObjectIterator* _poi;
|
174 }
175
176 static int col_width(julong n, const char *name) {
177 int w = julong_width(n);
178 int min = (int)(strlen(name));
179 if (w < min) {
180 w = min;
181 }
182 // add a leading space for separation.
183 return w + 1;
184 }
185
186 public:
187 KlassInfoHisto(KlassInfoTable* cit);
188 ~KlassInfoHisto();
189 void add(KlassInfoEntry* cie);
190 void print_histo_on(outputStream* st);
191 void sort();
192 };
193
194 class PrintClassLayout : AllStatic {
195 public:
196 static void print_class_layout(outputStream* st, char* classname);
197 };
198
199 #endif // INCLUDE_SERVICES
200
201 // These declarations are needed since the declaration of KlassInfoTable and
202 // KlassInfoClosure are guarded by #if INLCUDE_SERVICES
203 class KlassInfoTable;
204 class KlassInfoClosure;
205
206 class HeapInspection : public StackObj {
207 public:
208 void heap_inspection(outputStream* st, WorkerThreads* workers) NOT_SERVICES_RETURN;
209 uintx populate_table(KlassInfoTable* cit, BoolObjectClosure* filter, WorkerThreads* workers) NOT_SERVICES_RETURN_(0);
210 static void find_instances_at_safepoint(Klass* k, GrowableArray<oop>* result) NOT_SERVICES_RETURN;
211 };
212
213 // Parallel heap inspection task. Parallel inspection can fail due to
214 // a native OOM when allocating memory for TL-KlassInfoTable.
215 // _success will be set false on an OOM, and serial inspection tried.
216 class ParHeapInspectTask : public WorkerTask {
217 private:
218 ParallelObjectIterator* _poi;
|