-
Bug
-
Resolution: Fixed
-
P4
-
6u26, 6u31
-
b55
-
x86, sparc
-
solaris_10
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2224287 | 8 | Dean Long | P4 | Resolved | Fixed | b38 |
JDK-8021733 | 7u60 | Dean Long | P4 | Resolved | Fixed | b01 |
JDK-8021511 | 7u51 | Dean Long | P4 | Resolved | Fixed | b01 |
JDK-8018199 | 7u45 | Dean Long | P4 | Closed | Fixed | b05 |
JDK-8002475 | 7u40 | Dean Long | P4 | Closed | Fixed | b01 |
JDK-8016165 | 7u25 | Poonam Bajaj Parhar | P4 | Closed | Fixed | b31 |
JDK-8013641 | 7u21 | Poonam Bajaj Parhar | P4 | Closed | Fixed | b31 |
JDK-2225123 | 6u34 | Poonam Bajaj Parhar | P3 | Closed | Fixed | b03 |
JDK-2224940 | 6u33 | Poonam Bajaj Parhar | P3 | Closed | Fixed | b32 |
JDK-2225124 | hs20.9 | Poonam Bajaj Parhar | P4 | Closed | Won't Fix |
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
ADDITIONAL OS VERSION INFORMATION :
SunOS qs-sol10-64-a 5.10 Generic_139556-08 i86pc i386 i86pc
A DESCRIPTION OF THE PROBLEM :
My Java application connects to other JVMs using attach api to be able to connect with JMX after.
Works well on windows and linux. Almost on Solaris. The problem on solaris is the number of open file for each JVM receiving attach connection and the one creating it always increase. After few days it was 10k open files for each JVM.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
- Run sample with one arg to have a running JVM.
- Run sample with no arg to attach on the other one.
- Check open files for the first JVM process while attach/detach JVMs.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Number of open files should remain stable.
ACTUAL -
Number of open files always increase.
ERROR MESSAGES/STACK TRACES THAT OCCUR :
None.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
package attach;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.List;
import java.util.Properties;
import com.sun.tools.attach.AttachNotSupportedException;
import com.sun.tools.attach.VirtualMachine;
import com.sun.tools.attach.VirtualMachineDescriptor;
public class Main {
public static void main(String[] args) {
if (args.length == 1) {
int i = 0;
while (true) {
i++;
try {
Thread.sleep(10000L);
} catch (InterruptedException e) {
}
}
} else {
getVmInfos();
}
}
public static void getVmInfos() {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String tmp;
boolean again = true;
while (again) {
List<VirtualMachineDescriptor> vms = VirtualMachine.list();
for (VirtualMachineDescriptor vmd : vms) {
System.out.println("Name: " + vmd.displayName() + " , id: " + vmd.id() + ", Tostring: " + vmd.toString());
try {
VirtualMachine vm = VirtualMachine.attach(vmd);
Properties agentProps = vm.getAgentProperties();
System.out.println("Detach? ");
tmp = br.readLine();
if (tmp.startsWith("y")) {
vm.detach();
}
} catch (AttachNotSupportedException x) {
x.printStackTrace();
} catch (NumberFormatException e) {
e.printStackTrace();
} catch (Throwable e) {
e.printStackTrace();
}
}
try {
System.out.println("Again? ");
tmp = br.readLine();
again = tmp.startsWith("y");
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Use linux :P
- backported by
-
JDK-2224287 Attach api on Solaris, too many open files
- Resolved
-
JDK-8021511 Attach api on Solaris, too many open files
- Resolved
-
JDK-8021733 Attach api on Solaris, too many open files
- Resolved
-
JDK-2224940 Attach api on Solaris, too many open files
- Closed
-
JDK-2225123 Attach api on Solaris, too many open files
- Closed
-
JDK-2225124 Attach api on Solaris, too many open files
- Closed
-
JDK-8002475 Attach api on Solaris, too many open files
- Closed
-
JDK-8013641 Attach api on Solaris, too many open files
- Closed
-
JDK-8016165 Attach api on Solaris, too many open files
- Closed
-
JDK-8018199 Attach api on Solaris, too many open files
- Closed