I have an application that has a Service that uses an ArrayList<Double>
to store numbers in the background for a very long time; the variable is initialized when the service started.
The service is in the background, and there will be frequent access to the variable (that's why I don't want to use file management or settings -- it will be very expensive for a file I/O for the sake of battery life).
The variable will likely be ~1MB->2MB over its lifetime.
Is it safe to say that the variable will never be nulled by GC or the system, or is there any way to prevent it?