Memory crash in ExtJS V4.1.1, but not in ExtJS V4.0.7 Chrome 18
REQUIRED INFORMATION
Ext version tested:- ExtJS V4.1.1
- ExtJS V4.0.7
Browser versions tested against:
Description:- In ExtJS V4.1.1, Drawing a line of dynamic changes, the update time is set to 10 ms. When running about 10 minutes, the memory grew nearly 400M. Here is my data caption in Windows Task Manager.
Code:
147M(17:43:26) -> 232M(17:48:11)
But In ExtJS V4.0.7, Chrome 18: The page run with no problem. Here is my data:
Code:
64M(16:46:45) -> 100M[±15M](17:14:54) -> 90M[±10M](18:03:41) -> 90M[±10M](18:58:22) -> 95M[±10M](19:47:32)
In ExtJS V4.0.7, IE 9 still have the memory grow problem.
Steps to reproduce the problem:- call the doStart() function to start test
The result that was expected:
The result that occurs instead:- The memory been in growth
Test Case:
Code:
var timerUpdate = null;
var store = null;
var curIndex = 0;
var count = 10;
var yValue = 0;
var chart = null;
var gData = [];
Ext.Loader.setConfig({
disableCaching : false
});
Ext.require('Ext.chart.Chart');
Ext.define('coord',{
extend: 'Ext.data.Model',
fields: ['x', 'y']
});
Ext.onReady(function () {
createChart();
});
function createChart() {
if (store == null) {
store = Ext.create('Ext.data.Store',{
model: 'coord',
data:[
{x: 2, y:2}
]
});
}
if (chart == null) {
chart = Ext.create('Ext.chart.Chart', {
renderTo: 'chart',
width: 300,
height: 300,
store: store,
theme: 'Base',
axes: [{
title: 'y',
type: 'Numeric',
position: 'left',
fields: ['y'],
minimum: 0,
maximum: count
},{
title: 'x',
type: 'Numeric',
position: 'top',
fields: ['x'],
minimum: 0,
maximum: count
}],
series: [
{
type: 'line',
xField: 'x',
yField: 'y'
}
]
});
}
}
function destroyChart() {
if (chart) {
Ext.destroy(chart);
chart = null;
}
curIndex = 0;
}
function getData() {
if (store == null) {
return ;
}
yValue++;
if (yValue >= count) {
yValue = 0;
}
var data = [{x:curIndex, y:yValue}];
if ( curIndex <= 0 ) {
store.removeAll(true);
gData = [];
gData.push({x:curIndex, y:yValue});
} else if ( curIndex > count){
var i = 0;
var storeCount = gData.length;
for (i = 0; i < storeCount - 1; i++) {
gData[i].y = gData[i+1].y;
}
gData[i].y = data[0].y;
curIndex--;
} else {
gData.push({x:curIndex, y:yValue});
}
store.loadData(
gData
);
curIndex++;
// console.log(store.getCount()+"point");
}
function doStart() {
if (timerUpdate) {
clearInterval(timerUpdate);
timerUpdate = null;
}
timerUpdate = setInterval("getData()", 10);
}
function doStop() {
if (timerUpdate) {
clearInterval(timerUpdate);
timerUpdate = null;
}
destroyChart();
}
HELPFUL INFORMATION
Operating System: