[Scilab-users] Intensive memory allocation when changing plot X axes ticks.

classic Classic list List threaded Threaded
1 message Options
Grzegorz Grzegorz
Reply | Threaded
Open this post in threaded view
|

[Scilab-users] Intensive memory allocation when changing plot X axes ticks.

Dear Scilab users,

in my application I use plot and custom X axes ticks labes (timestamps). Aplication has to run for at least  24hours, but after few hours Windows terminates Scilab due to low memory. We noticed that chenging plot X labels causes memory allocation which results Scilab termination by OS. 

Here is a example code: 
x = 0:0.1:100;
y = sin(x);
plot(x,y);
plot_handle = gca();

while 1
    ticks = plot_handle.x_ticks
    cur_time = round(clock());
    ticks.labels = [ticks.labels(2:max(size(ticks.locations)));..
                    string(cur_time(4)) + ":" +.. // hour
                    string(cur_time(5)) + ":" +.. // minute
                    string(cur_time(6))];         // second
                    
    plot_handle.x_ticks = ticks;
    sleep(50);
end

What can cause such intensive memory allocation? Is there any workaround for this problem ?  
Obraz w treści 1Obraz w treści 2

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users