lundi 26 juin 2017

Java How to measure memory consumption for every method reflectivey

In my project I'm loading classes from JAR file and then reflectively i load methods.

What I'm trying to do is to measure or estimate memory usage for picked method. Should I invoke method and use runtime.totalMemory() - runtime.freeMemory() ? Or maybe there is other way to mesure/estimate memory usage. In addition I want to measure heap and stack memory usage.

But how should i make this working for every given method from JAR file ?





Aucun commentaire:

Enregistrer un commentaire