|
From: tryfonaration <far...@gm...> - 2013-10-31 08:33:47
|
The memory growth is observed in the program not gnuplot. This is the code
that is being called periodically every few seconds. extents_plot_handler =
gnuplot_init(); is only called once at some previous point.
int i;
char * cmd_header = "plot \"-\" matrix with image\n";
char * cmd = malloc(
sizeof(char)
* ((4 * extents_map_size)
+ (int) (extents_map_size / pixels_width) + 30));
strcpy(cmd, "");
cmd = concat(cmd, cmd_header);
for (i = 1; i <= extents_map_size; i++) {
cmd = concat(cmd, addr_space_extents_array[i - 1]);
if (i % pixels_width == 0) {
cmd = concat(cmd, "\n");
}
}
if (extents_map_size % pixels_width > 0) {
for (i = extents_map_size;
i
< (extents_map_size + pixels_width
- (extents_map_size % pixels_width)); i++) {
cmd = concat(cmd, "0 ");
}
}
if (extents_map_size % pixels_width > 0)
cmd = concat(cmd, "\ne\ne");
else
cmd = concat(cmd, "e\ne");
/*FILE *file;
char file_name[20];
sprintf(file_name, "temp_data%d.txt", temp_counter++);
file = fopen(file_name, "a+");
fprintf(file, "%s", cmd);
fclose(file);*/
fprintf(stderr,"extents_plot_handler size:
%d\n",sizeof(extents_plot_handler));
fprintf(stderr,"extents_plot_handler file size:
%d\n",sizeof(extents_plot_handler->gnucmd));
fprintf(stderr,"extents_plot_handler active plots:
%d\n",extents_plot_handler->nplots);
fprintf(stderr,"extents_plot_handler temporary files:
%d\n",extents_plot_handler->ntmp);
fprintf(stderr,"extents_plot_handler temp filename table size:
%d\n",sizeof(extents_plot_handler->tmp_filename_tbl));
gnuplot_cmd(extents_plot_handler, cmd);
free(cmd);
--
View this message in context: http://gnuplot.10905.n7.nabble.com/Memory-overload-in-real-time-plotting-tp17795p17798.html
Sent from the Gnuplot - User mailing list archive at Nabble.com.
|