title: Android - Google Maps API V2, Avoiding Memory Leak
body: <p>I was reading <a href="http://developer.android.com/reference/com/google/android/gms/maps/SupportMapFragment.html" rel="nofollow noreferrer">this documentation</a> on the <code>SupportMapFragmet</code>, and it says:</p>
  
  <blockquote>
    <p>Any objects obtained from the <strong>GoogleMap</strong> is associated with the view. It's important to not hold on to objects (e.g. <strong>Marker</strong>) beyond the view's life. Otherwise it will cause a <strong>memory leak</strong> as the view cannot be released. </p>
  </blockquote>
  
  <p>I am a little puzzled about this because there isn't a way to modify the <code>Markers</code> unless you hold a reference of them, like many questions in here say (like <a href="https://stackoverflow.com/questions/16367594/google-maps-v2-android-get-a-list-of-markers">this</a> and <a href="https://stackoverflow.com/questions/15368028/getting-a-map-marker-by-its-id-in-google-maps-v2">this</a>)... so is it there something that I am missing? </p>
  
  <p>I am currently using a <code>HashMap</code> to associate my <code>Markers</code> with other <code>Objects</code> and I can't see how to avoid it. Will this leak memmory? Is it there a recommended way to edit the <code>Marker</code>s and avoid memmory leak?</p>