How android deals with static classes?
<p>I got a class with the following architecture:</p>

<pre><code>public class StaticClass{
    private static LruCache&lt;Obj&gt; list = new LruCache&lt;Obj&gt;();

    public static LruCache&lt;Obj&gt; getList(){
           return list;
    }
}
</code></pre>

<p>Now, references to this list are used just in plain activities.
However, an activity launches a service which will continue to exist even after every activity is closed.
Given that a service exists in a process, do references to static list continue to exist?
I'm asking this because my service takes a lot of memory and I'm sure that memory should be less, moreover when I open the application again I see that everything is much faster (that lru cache is for bitmap caching) , so I'd guess that static continues to exist..</p>

<p><strong>edit:</strong>
It's really strange! If I nullify static references and then reopen application I get a null pointer exception from my cursor adapter! Indeed, cursor adapter code is like this:</p>

<pre><code>public MyAdapter(){
     cache = StaticClass.getCache();
}

public void bindView(View view, Context context, Cursor c) {
     cache.get(...) //this throws null pointer exception
</code></pre>

<p>so the only thing I can think of is that adapter is that my main activity is not closed...but it is: onDestroy() is called: I checked it! And my service has no reference at all to the adapter!</p>
