title: strange Memory Leak
body: <p><strong>Edit: I think there is a logic error in the code for parsing xml so there shouldnt be any leaks if it is written properly.</strong></p>
  
  <p>So i added my project an AsyncTask class that i wrote a while ago for quick testing purposes but it is causing memory leak errors.</p>
  
  <p>I am sure it is responsible because when i removed it leak problem goes away.</p>
  
  <p>Here is the heap dump file (already converted) <a href="http://www7.zippyshare.com/v/83628026/file.html" rel="nofollow">http://www7.zippyshare.com/v/83628026/file.html</a></p>
  
  <pre><code>package com.example.xmldl;
  
  import java.io.IOException;
  import java.io.InputStream;
  import java.net.HttpURLConnection;
  import java.net.MalformedURLException;
  import java.net.URL;
  import org.xmlpull.v1.XmlPullParser;
  import org.xmlpull.v1.XmlPullParserException;
  import android.os.AsyncTask;
  import android.util.Xml;
  
  public class Dlxml extends AsyncTask&lt;String, Void, Void&gt; {
      //adding or removing Override didnt matter just to let you know
      InputStream istream = null;
      protected Void doInBackground(String... url){
  
          try {
              downloadXml(url[0]);
          } catch (IOException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          }
          return null;
      }
  
      private void downloadXml(String url) throws IOException {   
          try {
              URL mUrl = new URL(url);
              HttpURLConnection urlConnection = (HttpURLConnection) mUrl.openConnection();
              istream = urlConnection.getInputStream();           
              XmlPullParser parser = Xml.newPullParser();
              parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, false);
              parser.setInput(istream, null);
              parser.nextTag();
              parser.require(XmlPullParser.START_TAG, null, "resources");
              while (parser.next() != XmlPullParser.END_TAG) {
                  if (parser.getEventType() == XmlPullParser.TEXT) {                  
                      parser.nextTag();                   
                  }
                  if (parser.getEventType() != XmlPullParser.START_TAG) {
                      continue;
                  }               
              }           
          } catch (MalformedURLException e) {
              e.printStackTrace();        
          } catch (XmlPullParserException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          }
          finally {
              istream.close();            
          }
  
      }
  
  }
  </code></pre>