fiji / Trainable_Segmentation

Fiji library to perform image segmentation based on the Weka learning schemes
https://imagej.net/Trainable_Weka_Segmentation
GNU General Public License v3.0
106 stars 60 forks source link

Log memory usage #39

Open tischi opened 7 years ago

tischi commented 7 years ago

The log window currently reports on how long each step takes, which is very nice!

However it would be also very good if the log window stated how much memory the feature stack currently needs as this might be also a limiting factor.

ctrueden commented 7 years ago

it would be also very good if the log window stated how much memory the feature stack currently needs as this might be also a limiting factor.

Java does not provide a built-in way to ask how much memory arbitrary objects are taking. So implementing this feature might be quite involved. That said, if there are arrays of primitives involved (which there often are), it would be doable to give a lower-bound estimate. But his feasible it is depends on how deeply those array references are buried in the types involved.

tischi commented 7 years ago

@ctrueden: I stage a pull request, where I tried to add logging the size of the feature stack: https://github.com/fiji/Trainable_Segmentation/pull/40 [EDIT]: ok, I just saw that you saw the request already.

iarganda commented 7 years ago

Thanks for your comments, @tischi and @ctrueden ! Apart from the memory taken by the feature stack array, there are related objects whose size might be worth measuring as well. I will have a look as soon as I can.