『楼 主』:
findstr对内存的影响!!!
不知道是不是我程序开多了,近来内存不够用了,我可是2G的啊!!
主要原因是近几天多次频繁使用findstr,而且使用时出现内存不足的堤示.而我以前开几天机都不会出现?我想问一下可不可以在使用后把内存释放出来呢?我没有虚拟内存的,有了就太慢了!不想用专门的内存释放工具,因为是使用了findstr才出的问题,就和它一定有关了!!
:lotus516于12月9日于bbs.cn-dos.net
e:
cd E:\自编程序区
curl -o tmp.txt http://bt.ydy.com
for /f "tokens=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,* delims=&<>" %%a in (tmp.txt) do echo %%a%%b%%c%%d%%e%%f%%g%%h%%i%%j%%k%%l%%m%%n%%o%%p%%q%%r%%s%%t%%u%%v%%w%%x%%y%%z>>E:\BitSpirit\Torrent\Readable\1.txt
del tmp.txt
cd E:\BitSpirit\Torrent\Readable
e:
dir /a-d /b *.torrent>zzwj_list.txt
set zzwjm=1
:2
set zzwjm=%zzwjm%
for /f "skip=%zzwjm% tokens=*" %%i in (zzwj.txt) do (
set /a zzwjm+=1
set wj=%%i&&goto :1
)
goto :end
:1
set count=1
set num2=1
:begin
set count=%count%
for /f "skip=%count% tokens=*" %%i in (1.txt) do (
set /a count+=1
echo "%%i"|findstr "%wj%">nul && goto :ok
)
goto 2
:ok
if "num2"=="1" set /a count=%count%-1&&set num2=2
for /f "skip=%count% tokens=3 delims==" %%i in (1.txt) do set zz=%%i&&goto dd
:dd
set ZZ2=%zz:~0,-8%
for /f "delims=" %%j in (zzwj_list.txt) do echo "%zz2%"|findstr "%%j">nul && goto :begin
curl -O %zz2%
start E:\BitSpirit\BitSpirit.exe %zz2%
goto begin
:end
del 1.txt 下面是zzwj.txt
:另起一行输入你要下载的电影!!!
我猜我猜我猜猜猜
越策越开心
康熙來了
週日八點黨
命运呼叫转移 本程序可以在后台自动为你下载电影(前提是在zzwj.txt输入了电影名),比特精灵用老板模式.
本程序大约是一个小时被其它P调用并运行一次.实验时start E:\BitSpirit\BitSpirit.exe %zz2%这一句并不存在!!也就是说不可能是BT影响的!!
想要下电影的也可以拿去啊!!目前只支持伊甸园的!!BT是比特精灵.
程序是正常的,就是比较耗内存!还没找到原因!!
还有一个P,也是要大量分析网页的!!
:lotus516于12月9日于bbs.cn-dos.net
setlocal ENABLEDELAYEDEXPANSION
:1
curl -O "http://weather.265.com/hn.htm"
if not exist hn.htm goto 1
cd.>1.txt
for /f "tokens=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,* delims=&<>/" %%a in (hn.htm) do echo %%a%%b%%c%%d%%e%%f%%g%%h%%i%%j%%k%%l%%m%%n%%o%%p%%q%%r%%s%%t%%u%%v%%w%%x%%y%%z>>1.txt
set count=1
set num=1
:2
for /f "skip=%count% tokens=*" %%i in (1.txt) do (
set /a count+=1
echo %%i|findstr "58828">nul &&goto :ok
)
:ok
if "%num%"=="1" set num=2&&goto :2
cd.>2.txt
for /f "skip=%count% tokens=*" %%i in (1.txt) do (
echo %%i|findstr "name">nul && goto :end
echo %%i>>2.txt
)
:end
pause
cd.>3.txt
for /f "tokens=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,* delims=abcdefghijklmnopqrstuvwxyz" %%a in (2.txt) do echo %%a%%b%%c%%d%%e%%f%%g%%h%%i%%j%%k%%l%%m%%n%%o%%p%%q%%r%%s%%t%%u%%v%%w%%x%%y%%z>>3.txt
cd.>4.txt
for /f "tokens=1,2,3,4,5,* delims=:" %%a in (3.txt) do if "%%b"=="" (echo %%a>>4.txt) else (echo %%b>>4.txt )
cd.>5.txt
for /f "tokens=1,2,3,* delims==" %%a in (4.txt) do if "%%c"=="" (echo %%a>>5.txt) else (echo %%c>>5.txt )
for /f "tokens=*" %%a in (5.txt) do call set "var=%%var%%%%a"
echo %var%>6.txt
del hn.htm 1.txt 2.txt 3.txt 4.txt 5.txt
for /f "tokens=1,2,3,4,5,6,7,8,9,10,11,12 delims= " %%a in (6.txt) do (
set 温度1=%%a
set 上午1=%%b
set 中午1=%%c
set 晚上1=%%d
set 温度2=%%e
set 上午2=%%f
set 中午2=%%g
set 晚上2=%%h
set 温度3=%%i
set 上午3=%%j
set 中午3=%%k
set 晚上3=%%l
)
copy /y E:\自编程序区\1.htm E:\自编程序区\2.htm
set replaced=温度1&&set all=%温度1%
call :th
set replaced=上午1&&set all=%上午1%
call :th
set replaced=中午1&&set all=%中午1%
call :th
set replaced=晚上1&&set all=%晚上1%
call :th
set replaced=温度2&&set all=%温度2%
call :th
set replaced=上午2&&set all=%上午2%
call :th
set replaced=中午2&&set all=%中午2%
call :th
set replaced=晚上2&&set all=%晚上2%
call :th
set replaced=温度3&&set all=%温度3%
call :th
set replaced=上午3&&set all=%上午3%
call :th
set replaced=中午3&&set all=%中午3%
call :th
set replaced=晚上3&&set all=%晚上3%
call :th
for /f "delims=" %%i in ('type "index.htm"') do echo %%i>>2.htm
copy E:\自编程序区\2.htm l:\index.htm
goto :eof
:th
setlocal enabledelayedexpansion
for /f "delims=" %%i in ('type "index.htm"') do (
set str=%%i
set "str=!str:%replaced%=%all%!"
echo !str!>>index.htm_tmp.txt
)
del /q index.htm
ren index.htm_tmp.txt index.htm
goto :eof index.htm见附见,改一下后缀名!!
再说一下,运行了P不到6个小时可用内存就从80%左右下到了13%左右,并且P不能再用了,再运行就提示说找不到程序(运行到findstr时),重启后就正常了!!而以前我连继续开机一个月都不会出现这种情况!!
[ Last edited by lotus516 on 2007-12-9 at 08:05 PM ]
附件
1: index.txt (2007-12-9 19:57, 12.09 K,下载次数: 6)
|