Thomas,
In regards to this earlier discussion....
what kicks the garbage collector in and when does it recover memory?
I've tried including it in my code but no joy.
in my BMP generation application, as soon as I hit 9941 images, the application crashes. This equates to 1.9G worth of files.
as the application is running, I watch memory usage in the windows task monitor continue to climb until the application crashes at approximately 1.98G to 2.04G.
here is the block of code where I create the images:
Code: Select all
drawGraphicMorse(INint):-
/*"MS Sans Serif"*/ % not used any more
% Offset= 10,
IN = toString(INint),
controlRCT = rct(_X1,_Y1,X2,Y2),
picWin := pictureCanvas::new(256,256),
picWin : setFont(vpi::fontCreateByName("Courier New",titleFontSize)),
picWin : setForeColor(color_black),
RAW = raw_Input_text,
translateor::translateor(RAW, MOrse, _ISOMORPH),
XT =convert(integer, math::random(220)),
YT = convert(integer, math::random(220)),
picWin : drawTextInRect(rct(XT,YT,X2,Y2),Morse, [dtext_Left ,dtext_Wordbreak]),
PIC = picWin:getPicture(),
FileName = string::concat("MORSE ", RAW, "-", IN, ".BMP"),
vpi::pictSave(PIC, FileName),
picWin := erroneous, % to release reference to the context
fail. % to further release reference
drawGraphicMorse(_INint):-!. % to ensure "succcess"
note that this is the only place where the picture canvas is used or referenced
the calling code operates the same way:
Code: Select all
cycleThrough():-
%retract value off database
retract(textToEncode(X)),
raw_Input_text:= X,
% set the new folder
directory::setCurrentDirectory("E:/research/SourcePhotos/Set -1-2/Morse"),
% create the MOrse version
foreach Counter = std::fromTo(1,10) do
% create 10 different version, using for loop.
randomFontSize(),
drawGraphicMorse(Counter)
end foreach,
...
memory::garbageCollect(),
fail.
cycleThrough().
I assume I am hitting a 32 bit memory boundry, but why am I not getting free memeory back?
is there anyway to recover this memory?
P.