I’m running root to perform task on severl dat-files with each 100 MB. The dat-files are written by a TNT2 card and are interpreted using a class (“TNT2pulseshape”) which is a public TObject and is loaded at the beginning of the macro.
My problem is now: whenever I submit to many files to the macro (or the standalone app which I made out of this macro) I run into memory problem of my machine: the memory quickly files up and soon the machine is almost unresponsible.
The data of the machine (which should be enough for this task):
- Mandriva 10.1
- dual Intel® Xeon™ CPU 2.80GHz
- 1 GB RAM
- swap 2 GB
The procesing steps of the files are:
They are handed over as an argument to the app (in the case of the compiled binary) where they are (in a for loop as long as their are arguments left) )handed over to the TNT2-class:
strcpy(infile,argv[argc_up]); TNT2pulseshape ps(infile,"TNT2");
Than I make in three fits for each event which is in the file (there are around 6k events each file each channel, I do only process one specific channel at the moment) with a while loop until there is no event left, and get back into the for loop to process the next argument.
I have the feeling that I miss it to “close” the file somehow somewhere, but I do not know how to do that or where to do that. If it is the task of the tnt2pulseshape class I can have a closer look at this - I didn’t wrote it by myself but have access to the sourcecode and can post it here if it makes sense, I think.