Closed jdpigeon closed 7 years ago
I notice that when the graph is running, the app keeps using more memory until it quickly hits the garbage collection limit, when it falls back down and keeps climbing. Memory monitor looks like a sawtooth pattern.
There's nothing inherently bad about a sawtooth memory pattern when it comes to GC - in fact It's generally recognized as a good sign as only an app that is not leaking memory can maintain it.
I think this fix could go a long way to making the library more applicable for fast, dynamic graphing
I'd love to understand a little more about your specific needs and how they either aren't being met or could be better met, in terms of numbers like frame rate, number of series, sample size etc. That will make it much easier for me to identify the most productive places in the code to optimize.
As far as optimizing from Double to primitive, while theres certainly room for further optimization, Androidplot needs to support many different use cases including those that use other primitive types and even those that can include null values. With regard to Region, thinking out loud, one approach that could accommodate all use cases would be to retrieve Region instances from a factory and to allow users to pass in their own factory implementation to produce Region instances optimized for the specific use case. In your case, since it sounds like you dont need to worry about null values in your series data, you very well could have an implementation that uses primitives internally.
Closing for now due to inactivity. Feel free to open back up with the requested details.
Hey there,
Been using the library for a while to plot fast biosensor data and just interested in optimizing it now.
I notice that when the graph is running, the app keeps using more memory until it quickly hits the garbage collection limit, when it falls back down and keeps climbing. Memory monitor looks like a sawtooth pattern.
With some memory sleuthing, I identified the culprit as being a vast number of Double objects corresponding to the x and y dimensions of my plot. I believe the Doubles are being created by the many
doubleValue()
calls in thetransform
andlength
functions in Region.javaIs there anyway to cut down the number of calls here or convert these Double classes to primitives? I'll be taking a look myself here, but not too familiar with what this class does.
I think this fix could go a long way to making the library more applicable for fast, dynamic graphing