Bug 194549 Memory leak in chart device renderers
After memory analysis for Chart code, it indicates java.awt.Font objects are not garbage collected. Investigating the renderer code, Graphics2D objects in IDisplayServer and IDeviceRenderer are not disposed after chart rendering finished. Need to invoke IDeviceRenderer.dispose() after ChartReportItemPresentationImpl being finished, and dispose all required resources in that method, including IDisplayServer and anything else.
chart/org.eclipse.birt.chart.device.extension/src/org/eclipse/birt/chart/device/swing/SwingTextRenderer.java
private final void showCenterValue( IPrimitiveRenderer ipr, Location lo,
			Label la, boolean bShadow )
	{
		Graphics2D g2d = (Graphics2D) ( (IDeviceRenderer) ipr ).getGraphicsContext( );
		double dX = lo.getX( ), dY = lo.getY( );
		FontDefinition fd = la.getCaption( ).getFont( );
		double dAngleInDegrees = fd.getRotation( );
		if ( bShadow ) 
		
		{
			bShadow = la.getShadowColor( ) != null;
		}
		Color clrText = (Color) _sxs.getColor( la.getCaption( ).getColor( ) );
		Color clrBackground = null;
		if ( la.getBackground( ) != null )
		{
			clrBackground = (Color) _sxs.getColor( (ColorDefinition) la.getBackground( ) );
		}
		final double dAngleInRadians = ( ( -dAngleInDegrees * Math.PI ) / 180.0 );
		final double dSineTheta = ( Math.sin( dAngleInRadians ) );
		final double dCosTheta = ( Math.cos( dAngleInRadians ) );
		final ITextMetrics itm = new SwingTextMetrics( _sxs, la );
		final double dFW = itm.getFullWidth( );
		final double dH = itm.getHeight( );
		final double dD = itm.getDescent( );
		final double dFH = itm.getFullHeight( );
		double dXOffset = 0, dW = 0;
		final int iLC = itm.getLineCount( );
		final Insets ins = la.getInsets( )
				.scaledInstance( _sxs.getDpiResolution( ) / 72d );