Skip to content

Commit 19bfa23

Browse files
Update readme.txt
1 parent dcc5e48 commit 19bfa23

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

readme.txt

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,32 @@
11
ObjectExplorer, by Dimitris Andreou ([email protected])
22

3-
See package javadocs for information.
3+
= Introduction =
4+
5+
==[http://memory-measurer.googlecode.com/svn/trunk/dist/javadoc/index.html Javadocs]==
6+
7+
A small tool that is very handy when e.g. you design data structures and want to see how much memory each one uses. To do this, it uses a simple reflection-based object-traversing framework ([http://memory-measurer.googlecode.com/svn/trunk/dist/javadoc/objectexplorer/ObjectExplorer.html ObjectExplorer]). On it, it builds two facilities:
8+
9+
* [http://memory-measurer.googlecode.com/svn/trunk/dist/javadoc/objectexplorer/MemoryMeasurer.html MemoryMeasurer], which can estimate the memory footprint of an object graph _in bytes_. This requires installing a javaagent when running the JVM, e.g. by passing {{{-javaagent:path/to/object-explorer.jar}}}.
10+
11+
* [http://memory-measurer.googlecode.com/svn/trunk/dist/javadoc/objectexplorer/ObjectGraphMeasurer.html ObjectGraphMeasurer] does not need a javaagent, and can also give a much more qualitative measurement than !MemoryMeasurer - it counts the number of objects, references, and primitives (of each kind) that an object graph entails.
12+
13+
Also of interest is the synergy with this project (of yours truly) : [http://code.google.com/p/jbenchy/ JBenchy]
14+
15+
Put together, they allow you to easily and systematically run and analyze benchmarks regarding data structures.
16+
17+
== How to use ==
18+
19+
An extremely simple example:
20+
21+
{{{
22+
long memory = MemoryMeasurer.measureBytes(new HashMap());
23+
}}}
24+
25+
or
26+
27+
{{{
28+
Footprint footprint = ObjectGraphMeasurer.measure(new HashMap());
29+
}}}
430

531
Quick tip: To use the MemoryMeasurer (to measure the footprint of an object
632
graph in bytes), this parameter needs to be passed to th VM:

0 commit comments

Comments
 (0)