Bug 183162 OutOfMemoryError
In some case (depends on data), during the design or even in the web viewer, an outOfMemoryError occured when try to creates / display a chart (bar, line, scatter) with these kind of values : X = toto for example ;) Y = -45000000 Error with 2.1.1 or 2.2 M6. After some little search, it seems that it comes from the Autoscale class which tries to computeTicks with a step of 1 (=> initialization of a double[90000000]). I suggest when min = max, to set the min or max value to 0. The step is then, well computed. Just for my comprehension, i'm not sure the getPrecision method works fine or comments are not synchronise with the code: - I always get a NaN for negative values (abs on log(value)), - The while that verify precision always return 1 (precision /= 10 ...) - The return value is supposed to be a 10 power.
chart/org.eclipse.birt.chart.engine/src/org/eclipse/birt/chart/computation/withaxes/AutoScale.java
{
	private final int iType;
	private Object oMinimum;
	private Object oMaximum;
	
	/**
	 * Minimum without considering fixed value. Only valid if margin percent is
	 * set and real minimum is less than fixed minimum.
	 */
	private Object oMinimumWithMargin = null;
	/**
	 * Maximum without considering fixed value. Only valid if margin percent is
	 * set and real maximum is greater than fixed maximum.
	 */
	private Object oMaximumWithMargin = null;
	private Object oStep;
	private Integer oStepNumber;
	private Object oUnit;
	private double dStartShift;
	private double dEndShift;
	private double dZoomFactor = 1.0;
	
	private int iMarginPercent = 0;