cpicanco / stimulus_control

A teaching machine for free behavioral experiments
GNU General Public License v3.0
11 stars 7 forks source link

Reduce memory use #6

Open cpicanco opened 9 years ago

cpicanco commented 9 years ago

All session parameters are saved inside text files with the INI file structure:

[Section] Key=Value

In the current implementation (unit/session_config.pas) the program will load some of this values through a custom (overrided) ReadSectionValues method;

TCIniFile = class (TIniFile) public procedure ReadSectionValues(const Section: string; Strings: TStrings); override; end;

The memory used grows very fast in some circumstances, because all trial sections Key=values are stored inside TSringList's.

Specially when the 'NextTrial= x' feature is used to jump over trials, there is no need to load this trials into memory.

So a solution may be to load the current and the following trial at the beginning of each trial.

cpicanco commented 6 years ago

An alternative to reduce the memory use is being evaluated in f589c71c404e4caf9220ccd4750101f6c777c1d6.

The idea is use a TInifile as a global stream.