|
Lines 46-57
Link Here
|
| 46 |
private static final Column COL_SHALLOW = new Column(Messages.Column_ShallowHeap, int.class); |
46 |
private static final Column COL_SHALLOW = new Column(Messages.Column_ShallowHeap, int.class); |
| 47 |
private static final Column COL_RETAINED = new Column(Messages.Column_RetainedHeap, long.class); |
47 |
private static final Column COL_RETAINED = new Column(Messages.Column_RetainedHeap, long.class); |
| 48 |
private static final Column COL_CONTEXTCL = new Column(Messages.ThreadInfoImpl_Column_ContextClassLoader); |
48 |
private static final Column COL_CONTEXTCL = new Column(Messages.ThreadInfoImpl_Column_ContextClassLoader); |
|
|
49 |
private static final Column COL_ISDAEMON = new Column(Messages.ThreadInfoImpl_Column_IsDaemon, Boolean.class); |
| 49 |
|
50 |
|
| 50 |
private static final List<Column> defaultColumns = Arrays.asList(new Column[] { COL_NAME, // |
51 |
private static final List<Column> defaultColumns = Arrays.asList(new Column[] { COL_NAME, // |
| 51 |
COL_INSTANCE, // |
52 |
COL_INSTANCE, // |
| 52 |
COL_SHALLOW, // |
53 |
COL_SHALLOW, // |
| 53 |
COL_RETAINED, // |
54 |
COL_RETAINED, // |
| 54 |
COL_CONTEXTCL }); |
55 |
COL_CONTEXTCL, |
|
|
56 |
COL_ISDAEMON}); |
| 55 |
|
57 |
|
| 56 |
// ////////////////////////////////////////////////////////////// |
58 |
// ////////////////////////////////////////////////////////////// |
| 57 |
// factory methods |
59 |
// factory methods |
|
Lines 109-114
Link Here
|
| 109 |
info.instance = info.subject.getTechnicalName(); |
111 |
info.instance = info.subject.getTechnicalName(); |
| 110 |
info.shallowHeap = info.subject.getUsedHeapSize(); |
112 |
info.shallowHeap = info.subject.getUsedHeapSize(); |
| 111 |
info.retainedHeap = info.subject.getRetainedHeapSize(); |
113 |
info.retainedHeap = info.subject.getRetainedHeapSize(); |
|
|
114 |
info.isDaemon = resolveIsDaemon(info.subject); |
| 112 |
|
115 |
|
| 113 |
IObject contextClassLoader = (IObject) info.subject.resolveValue("contextClassLoader"); //$NON-NLS-1$ |
116 |
IObject contextClassLoader = (IObject) info.subject.resolveValue("contextClassLoader"); //$NON-NLS-1$ |
| 114 |
if (contextClassLoader != null) |
117 |
if (contextClassLoader != null) |
|
Lines 120-125
Link Here
|
| 120 |
} |
123 |
} |
| 121 |
} |
124 |
} |
| 122 |
|
125 |
|
|
|
126 |
private static Boolean resolveIsDaemon(IObject thread) |
| 127 |
{ |
| 128 |
try |
| 129 |
{ |
| 130 |
Object daemon = thread.resolveValue("daemon"); |
| 131 |
if (daemon == null) { |
| 132 |
daemon = thread.resolveValue("isDaemon"); |
| 133 |
} |
| 134 |
if (daemon != null) { |
| 135 |
if (daemon instanceof Boolean) { |
| 136 |
return (Boolean)daemon; |
| 137 |
} |
| 138 |
} |
| 139 |
} |
| 140 |
catch (SnapshotException e) |
| 141 |
{ |
| 142 |
// Failing to get daemon status is not the end of the world |
| 143 |
} |
| 144 |
return null; |
| 145 |
} |
| 146 |
|
| 123 |
private static void extractFromDetailsResolver(ThreadInfoImpl info, boolean readFully, IProgressListener listener) |
147 |
private static void extractFromDetailsResolver(ThreadInfoImpl info, boolean readFully, IProgressListener listener) |
| 124 |
throws SnapshotException |
148 |
throws SnapshotException |
| 125 |
{ |
149 |
{ |
|
Lines 185-190
Link Here
|
| 185 |
private long retainedHeap; |
209 |
private long retainedHeap; |
| 186 |
private String contextClassLoader; |
210 |
private String contextClassLoader; |
| 187 |
private int contextClassLoaderId; |
211 |
private int contextClassLoaderId; |
|
|
212 |
private Boolean isDaemon; |
| 188 |
|
213 |
|
| 189 |
// extended properties |
214 |
// extended properties |
| 190 |
private Map<Column, Object> properties = new HashMap<Column, Object>(); |
215 |
private Map<Column, Object> properties = new HashMap<Column, Object>(); |
|
Lines 273-278
Link Here
|
| 273 |
{ |
298 |
{ |
| 274 |
return requests; |
299 |
return requests; |
| 275 |
} |
300 |
} |
|
|
301 |
|
| 302 |
private Object isDaemon() |
| 303 |
{ |
| 304 |
return isDaemon; |
| 305 |
} |
| 276 |
|
306 |
|
| 277 |
public Object getValue(Column column) |
307 |
public Object getValue(Column column) |
| 278 |
{ |
308 |
{ |
|
Lines 286-291
Link Here
|
| 286 |
return getRetainedHeap(); |
316 |
return getRetainedHeap(); |
| 287 |
else if (column == COL_CONTEXTCL) |
317 |
else if (column == COL_CONTEXTCL) |
| 288 |
return getContextClassLoader(); |
318 |
return getContextClassLoader(); |
|
|
319 |
else if (column == COL_ISDAEMON) |
| 320 |
return isDaemon(); |
| 289 |
else |
321 |
else |
| 290 |
return properties.get(column); |
322 |
return properties.get(column); |
| 291 |
} |
323 |
} |