java - Downloading blob file on JDBC causes memory leak if internet is cutoff during preparedstatement.execute() -
i trying make robust application can download blob files mysql server. files executables or other binary files. download works well, want bullet proof survive internet cutoff midway in download. if internet cutoff occurs before preparedstatement.execute(),everything goes well, memory cleared of garbage , program exits gracefully . on other hand ,if cutoff internet 5 seconds execution of preparedstatement.execute(),the thread downloading hangs indefinitely , never cleared garbage collector , program never exits. main exits,the downloader manager exits,but downloading thread never exits. methodology: (1)main thread trigger downloadmanager object existence. (2)downloadermanager object trigggers separate puredownload object(in separate thread) invoke prepared statement get binary data make downloads. (3)downloadermanager polls puredownload object detect if cutoff connection has caused become unresponsive , tries kill it. observing heap dump on netbeans, puredownload o...