When using Rasterize on a Graphics expression composed of many differently coloured Graphics objects memory is allocated in the frontend which is then not released or reused when a similar graphic object is created.
Rasterize (or its underlying machinery) is used underneath Export when a graphic object is exported using Export, for instance when creating a jpg file.
In the example given 4 MB of memory is allocated each cycle but not freed. Eventually the frontend will crash.
Do[Sleep[3]; img = Rasterize[Graphics[Table[
{ ColorData["TemperatureMap"][RandomReal[]], Circle[{RandomReal[], RandomReal[]}, 1.0] },
{1000}]]], {1000}];
Does anyone know if this is a known bug and if there are any workarounds pending a fix from Wolfram?
Pause
. I seem to have the reported behavior too (Win7-64/mma8.04). $\endgroup$