Fixed infinite wait in DownloadMonitor by letting JVM manage memory. Added a test program for this.