-
Bug
-
Resolution: Fixed
-
P4
-
1.1.4, 1.1.6, 1.1.7, 1.1.8
-
kestrel
-
generic, x86
-
windows_95, windows_nt
There is a resource exhaustion problem which is specific to Windows '95
and Windows '98 - it does not affect NT 4.0
It is present in all Sun JDK versions including JDK 1.1.6, and JDK 1.2 Beta
releases.
It is related to the crash of bug 4040282 which has been fixed, but the resource
exhaustion problem still exists.
Every "window" you create on a Windows '95 system, consumes user/system
resources from a very limited global heap.
Somewhere between 1,000-1,200 windows appears to be the absolute limit.
These do not have to be top-level windows, but the Microsoft win32 APIs typically create controls as Windows.
A similarly architected application written directly in C++ using MFC would
probably encounter the same problem.
The Sun win32 AWT implementation creates every concrete AWT UI component in
a separate "window", and so is afflicted.
Here is a test program. Note the component type is irrelevant.
/**
* Sample class which allocates 40 windows containing
* each 50 labels in a 5 by 10 grid. A total of 2000
* text labels are created.
*
* This test will fail on Win95 using JDK1.1.6 when
* 1,000-1,200 labels are created, due to lack of system
* or user resources. You can use the Resource Meter
* utillity to observer the percentage of free resources.
* This tool can be found in the Start menu under
* Programs/Accessories/System Tools.
*
*/
import java.awt.*;
class gtest {
public static void main(String argv[]) {
Toolkit tk = Toolkit.getDefaultToolkit();
int count = 0;
try {
for (int i = 0 ; i < 40 ; i++) {
Frame f = new Frame(String.valueOf(i));
f.reshape(10 + i*4, 10 + i*10, 400, 300);
f.setLayout(new GridLayout(10, 5));
for (int j = 0 ; j < 50 ; j++) {
Component c = new Label(i + "," + j);
f.add(c);
count++;
}
f.show();
System.out.println("count=" + count);
}
} finally {
System.out.println("final count=" + count);
}
}
}
and Windows '98 - it does not affect NT 4.0
It is present in all Sun JDK versions including JDK 1.1.6, and JDK 1.2 Beta
releases.
It is related to the crash of bug 4040282 which has been fixed, but the resource
exhaustion problem still exists.
Every "window" you create on a Windows '95 system, consumes user/system
resources from a very limited global heap.
Somewhere between 1,000-1,200 windows appears to be the absolute limit.
These do not have to be top-level windows, but the Microsoft win32 APIs typically create controls as Windows.
A similarly architected application written directly in C++ using MFC would
probably encounter the same problem.
The Sun win32 AWT implementation creates every concrete AWT UI component in
a separate "window", and so is afflicted.
Here is a test program. Note the component type is irrelevant.
/**
* Sample class which allocates 40 windows containing
* each 50 labels in a 5 by 10 grid. A total of 2000
* text labels are created.
*
* This test will fail on Win95 using JDK1.1.6 when
* 1,000-1,200 labels are created, due to lack of system
* or user resources. You can use the Resource Meter
* utillity to observer the percentage of free resources.
* This tool can be found in the Start menu under
* Programs/Accessories/System Tools.
*
*/
import java.awt.*;
class gtest {
public static void main(String argv[]) {
Toolkit tk = Toolkit.getDefaultToolkit();
int count = 0;
try {
for (int i = 0 ; i < 40 ; i++) {
Frame f = new Frame(String.valueOf(i));
f.reshape(10 + i*4, 10 + i*10, 400, 300);
f.setLayout(new GridLayout(10, 5));
for (int j = 0 ; j < 50 ; j++) {
Component c = new Label(i + "," + j);
f.add(c);
count++;
}
f.show();
System.out.println("count=" + count);
}
} finally {
System.out.println("final count=" + count);
}
}
}
- duplicates
-
JDK-4182347 Excessive use of Resouces under Win95
-
- Closed
-
-
JDK-4088662 Choices and Lists consume a lot of user and system resources
-
- Closed
-
- relates to
-
JDK-4040282 win95: Resource exhaustion causes Win 95 crash
-
- Closed
-