Class-wise profiling of Java memory consumption -
i have java project initializes thousands of objects in tree-like hierarchy.
initially, programming performance in mind , didn't mind storing lot of computable properties in class fields(variables)..
however, recently, started trying estimate memory footprint of project , found large.
i'm trying identify class consumes memory
guess can narrow down field consuming (probably strings)
i have come across java's instrumentation
package , getobjectsize
i tried understanding documentation, i'm not sure if instrumentation
suited task.
have noticed getobjectsize
not recursively find sizes.
i thinking of creating class extends object
, contains static map of instance -> instancesize
, , making classes extend class , updating constructors
is approach correct?
'java' way of accomplishing this?
um, put down coding tools , pick memory profiler. there great free ones out there.
Comments
Post a Comment