-
Bug
-
Resolution: Fixed
-
P3
-
fx1.3
-
Windows , FX1.3
Partner reported issue :
Out of memory while inserting and removing contents into the scene.
Reproducible case :
Here is a sample program I wrote to reproduce the issue...
package timosoutofmemoryissue;
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.text.Text;
import javafx.scene.text.Font;
import javafx.scene.shape.Rectangle;
import javafx.scene.paint.Color;
import javafx.scene.shape.Circle;
/**
* @author Guru Sakaleshpura
*/
public function testmemlimit() {
var seq ;
for (m in [0..500]) {
for (i in [0..500]) {
insert Rectangle {
x: i, y: 10
width: 20, height: 20
fill: Color.RED
}
into stage.scene.content;
}
println("sizeof stage.scene.content: {sizeof stage.scene.content}");
seq = Main.stage.scene.content[node | not (node instanceof Rectangle)];
stage.scene.content = seq;
println("sizeof stage.scene.content: {sizeof stage.scene.content}");
}
}
var scene:Scene = Scene {
content :[]
}
var stage:Stage = Stage {
scene: scene
width: 320
height: 240
}
function run() {
testmemlimit();
stage;
}
//----------------------------------------------------------------------------------
Out of memory while inserting and removing contents into the scene.
Reproducible case :
Here is a sample program I wrote to reproduce the issue...
package timosoutofmemoryissue;
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.text.Text;
import javafx.scene.text.Font;
import javafx.scene.shape.Rectangle;
import javafx.scene.paint.Color;
import javafx.scene.shape.Circle;
/**
* @author Guru Sakaleshpura
*/
public function testmemlimit() {
var seq ;
for (m in [0..500]) {
for (i in [0..500]) {
insert Rectangle {
x: i, y: 10
width: 20, height: 20
fill: Color.RED
}
into stage.scene.content;
}
println("sizeof stage.scene.content: {sizeof stage.scene.content}");
seq = Main.stage.scene.content[node | not (node instanceof Rectangle)];
stage.scene.content = seq;
println("sizeof stage.scene.content: {sizeof stage.scene.content}");
}
}
var scene:Scene = Scene {
content :[]
}
var stage:Stage = Stage {
scene: scene
width: 320
height: 240
}
function run() {
testmemlimit();
stage;
}
//----------------------------------------------------------------------------------