Skip to content

mesureBytes #3

@GoogleCodeExporter

Description

@GoogleCodeExporter
Hi

I am doing the following

long totalMemory = Runtime.getRuntime().totalMemory();
MyObject = createMyObject(args);
memoryGuessed = Runtime.getRuntime().totalMemory() - totalMemory;

Footprint footprint = ObjectGraphMeasurer.measure(appSession);
log.info("footprint.toString()
      + " memory:" + MemoryMeasurer.measureBytes(appSession) 
      + " memoryGuessed:" + memoryGuessed
      );

And the result is 
footprint:Footprint{Objects=70992, References=194939, Primitives=[int x 63043, 
long x 452, char x 437906, byte x 78594, boolean x 12100, float x 2331]} 
memory:2821976 memoryGuessed:327680

I am using:
Ubuntu 12.04.2 LTS, Precise Pangolin
Linux ubuntu 3.2.0-43-generic-pae #68-Ubuntu SMP Wed May 15 03:55:10 UTC 2013 
i686 i686 i386 GNU/Linux

Why is memory x8 greater than memoryGuessed? Could it be that memory is bits 
and not bytes? Am I missing something? Thank you for your help!

Original issue reported on code.google.com by [email protected] on 23 May 2013 at 6:56

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions