JDK-6255275 : Memory leak in getNetworkInterfaces
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 1.4.2
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_xp
  • CPU: other
  • Submitted: 2005-04-14
  • Updated: 2010-04-02
  • Resolved: 2005-04-14
Related Reports
Duplicate :  
Description
OPERATING SYSTEM(S)
FULL JDK VERSION(S): 1.4.2
DESCRIPTION:
---------- BEGIN SOURCE ----------
import java.io.*;
import java.net.*;
import java.util.*;
/**
 * Class for demonstrating memory leak in Linux JDK.
 */
public class Test {
    static public void main(String[] args) throws Exception {
        for (;;) {
            NetworkInterface.getNetworkInterfaces();
        }
    }
}
---------- END SOURCE ----------
Running this code under a symbolic debugger shows that memory is allocated
in native code and not freed.  The source of the error is a fix previously 
issued to Sun - a call to freeif(ifs) was mistakenly coded as free(ifs).
[This bug is being submitted as a courtesy, in order to maintain uniformity between Sun & IBM JDKs.  It has been fixed in IBM JDKs.  
Please contact ###@###.### if you have questions.]
###@###.### 2005-04-14 13:42:51 GMT