-
Bug
-
Resolution: Not an Issue
-
P3
-
None
-
5.0
-
x86
-
windows_xp
FULL PRODUCT VERSION :
JDK 1.5 update 6
ADDITIONAL OS VERSION INFORMATION :
Happens in Windows XP and Linux. This isn't an OS specific problem.
A DESCRIPTION OF THE PROBLEM :
DecimalFormat with empty string causes OutOfMemoryError: Java heap space in toPattern method.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
DecimalFormat df = new DecimalFormat("");
System.out.println(df.toPattern());
Under JDK 1.4.2, this returns:
#,###.##########################################################################
################################################################################
################################################################################
################################################################################
##########################
Under JDK 1.5 06, this causes the following exception:
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
#,###.##########################################################################
################################################################################
################################################################################
################################################################################
##########################
ACTUAL -
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
ERROR MESSAGES/STACK TRACES THAT OCCUR :
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.text.DecimalFormat;
public class TestDecimalFormat {
public static void main(String[] args) {
DecimalFormat df = new DecimalFormat("");
System.out.println(df.toPattern());
}
}
---------- END SOURCE ----------
Release Regression From : 1.4.2_10
The above release value was the last known release where this
bug was known to work. Since then there has been a regression.
JDK 1.5 update 6
ADDITIONAL OS VERSION INFORMATION :
Happens in Windows XP and Linux. This isn't an OS specific problem.
A DESCRIPTION OF THE PROBLEM :
DecimalFormat with empty string causes OutOfMemoryError: Java heap space in toPattern method.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
DecimalFormat df = new DecimalFormat("");
System.out.println(df.toPattern());
Under JDK 1.4.2, this returns:
#,###.##########################################################################
################################################################################
################################################################################
################################################################################
##########################
Under JDK 1.5 06, this causes the following exception:
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
#,###.##########################################################################
################################################################################
################################################################################
################################################################################
##########################
ACTUAL -
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
ERROR MESSAGES/STACK TRACES THAT OCCUR :
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.text.DecimalFormat;
public class TestDecimalFormat {
public static void main(String[] args) {
DecimalFormat df = new DecimalFormat("");
System.out.println(df.toPattern());
}
}
---------- END SOURCE ----------
Release Regression From : 1.4.2_10
The above release value was the last known release where this
bug was known to work. Since then there has been a regression.
- duplicates
-
JDK-8230114 DecimalFormat.toLocalizedPattern() can cause OOME
-
- Closed
-
- relates to
-
JDK-8230114 DecimalFormat.toLocalizedPattern() can cause OOME
-
- Closed
-
-
JDK-4969995 [Fmt-Nu] NumberFormat.setMaximumFractionDigits set to Integer.MAX_VALUE causes mem. leak
-
- Closed
-