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

Grzegorz Skiba skiba.g at gmail.com
Fri Aug 26 12:36:42 CEST 2016


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 ?
[image: Obraz w treści 1][image: Obraz w treści 2]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20160826/88cc545b/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: memory_leak_x_ticks_total_ram.PNG
Type: image/png
Size: 2574 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/users/attachments/20160826/88cc545b/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: memory_leak_x_ticks.PNG
Type: image/png
Size: 5010 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/users/attachments/20160826/88cc545b/attachment-0001.png>


More information about the users mailing list