Looking at the task manager, the memory usage keeps rising and rising up the point of system crash. The strange thing is that no single process ever shows up with more than 50MB in the process list at any time.
Also, when stopping the program and trying to clear memory manually, it only barely does so, clearing up maybe 200MB or so.
The only thing done is counting the number of lines containing the string ":\".
Code: Select all
set /a cnt=0
for /f "delims=" %%i in (list.txt) do (
set "line=%%i"
echo "!line!" | find /i ":\" > nul
if not !errorlevel!==1 (set /a cnt=!cnt!+1)
)
Code: Select all
set /a cnt=0
set /a k=0
:Loop
set /a k=%k%+1
for /f "skip=%k% delims=" %%i in (list.txt) do (set "line=%%i" & goto Loop2)
:Loop2
if "%line%"=="end line" (goto end)
echo "%line%" | find /i ":\" > nul
if not %errorlevel%==1 (set /a cnt=%cnt%+1)
goto Loop
My question is how do I successfully clear up memory in this case?
My plan was to constantly check on how much memory is available. When a certain threshold is reached, the loop is terminated and all progress is written to a tempory file. Memory would then be cleared and a new loop would be started.