equal
deleted
inserted
replaced
266 |
266 |
267 StringStat() { |
267 StringStat() { |
268 VM vm = VM.getVM(); |
268 VM vm = VM.getVM(); |
269 SystemDictionary sysDict = vm.getSystemDictionary(); |
269 SystemDictionary sysDict = vm.getSystemDictionary(); |
270 InstanceKlass strKlass = sysDict.getStringKlass(); |
270 InstanceKlass strKlass = sysDict.getStringKlass(); |
271 // String has a field named 'value' of type 'char[]'. |
271 // String has a field named 'value' of type 'byte[]'. |
272 stringValueField = (OopField) strKlass.findField("value", "[C"); |
272 stringValueField = (OopField) strKlass.findField("value", "[B"); |
273 } |
273 } |
274 |
274 |
275 private long stringSize(Instance instance) { |
275 private long stringSize(Instance instance) { |
276 // We include String content in size calculation. |
276 // We include String content in size calculation. |
277 return instance.getObjectSize() + |
277 return instance.getObjectSize() + |