rvhaasen
02-20-2009, 07:29 AM
Hi, i have the following problem:
When the stroke() is called repeatedly (from a drawview derived class), the application is increasing the CPU load. After some minutes 100% CPU is used on a single core cpu, and the browser is not responding anymore. Tested on firefox and iexplorer, using for OL 4.1.1 and OL 4.2.0. Flash 8.
The effect can be demonstrated with the following code:
<canvas debug="false">
<include href="utils/4.1.x_compatibility.lzx"/>
<class name="historyChart" extends="drawview" height="100" width="200">
<method name="redraw" > <![CDATA[
this.beginPath()
this.rect(0,0,100,100)
this.closePath()
this.stroke();
]]></method>
</class>
<view name="mainView" >
<historyChart name="chart"/>
<handler name="oninit">
this.del = new LzDelegate(this,"updateTimer");
LzTimer.addTimer(this.del,100);
</handler>
<method name="updateTimer">
chart.redraw();
LzTimer.resetTimer(canvas.mainView.del,100);
</method>
</view>
</canvas>
When the line "this.stroke()" is removed, the CPU load is not increasing,
therefore i do suspect this method.
Is this a bug? Is there a solution for this problem?
Rick
When the stroke() is called repeatedly (from a drawview derived class), the application is increasing the CPU load. After some minutes 100% CPU is used on a single core cpu, and the browser is not responding anymore. Tested on firefox and iexplorer, using for OL 4.1.1 and OL 4.2.0. Flash 8.
The effect can be demonstrated with the following code:
<canvas debug="false">
<include href="utils/4.1.x_compatibility.lzx"/>
<class name="historyChart" extends="drawview" height="100" width="200">
<method name="redraw" > <![CDATA[
this.beginPath()
this.rect(0,0,100,100)
this.closePath()
this.stroke();
]]></method>
</class>
<view name="mainView" >
<historyChart name="chart"/>
<handler name="oninit">
this.del = new LzDelegate(this,"updateTimer");
LzTimer.addTimer(this.del,100);
</handler>
<method name="updateTimer">
chart.redraw();
LzTimer.resetTimer(canvas.mainView.del,100);
</method>
</view>
</canvas>
When the line "this.stroke()" is removed, the CPU load is not increasing,
therefore i do suspect this method.
Is this a bug? Is there a solution for this problem?
Rick