title: How can i force Android to garbage collect old socket information?
body: <p>I have project where i'm developing an Android App using a lot of existing C++ code accessed through JNI which opens and closes sockets. </p>
  
  <p>Even though this C++  properly handles the closeing of the sockets it opens, it seems either the Android OS or the JVM keeps around references to those sockets/ports being used until the next GC call. </p>
  
  <p>What happens is if we stop the app and start it again before the next GC call, the app cannot create connections on that same socket/port. If we wait for GC to be called by the OS and <em>then</em> restart the app, it successfully creates the connections. </p>
  
  <p>Is there a way to manually free up a socket from Android's/the JVM's perspective? Perhaps a socket class utility? A manual call to GC?</p>