« [Ruby] Win32OLE のメモリーリーク その5 | トップページ | [Ruby] Win32OLE のメモリーリーク その7 »

2010年1月17日 (日)

[Ruby] Win32OLE のメモリーリーク その6

60MBぐらいのHTMLを読み込ませて、しばらく実行させてみた。


require 'win32ole'
def bnavigate2(url, flags,target, post, headers, cancel)
urls = {}
urls[url.locationURL] = url.document.body.innerText
end
ie = WIN32OLE.new('InternetExplorer.Application')
ie.visible = TRUE
ie.gohome
ev = WIN32OLE_EVENT.new(ie, 'DWebBrowserEvents2')
ev.on_event("BeforeNavigate2") {|url, flags, target, post, headers, cancel|
bnavigate2(url, flags, target, post, headers, cancel)
}
while 1
ie.navigate2("file:///c:/.../60mb.html") # 60MBぐらいのHTMLファイル
while ie.readystate !=4 || ie.busy
WIN32OLE_EVENT.message_loop
sleep 0.1
end
ie.navigate2("http://www.ruby-lang.org")
while ie.readystate !=4 || ie.busy
WIN32OLE_EVENT.message_loop
sleep 0.1
end
ie.navigate2("http://www.google.com")
while ie.readystate !=4 || ie.busy
WIN32OLE_EVENT.message_loop
sleep 0.1
end
end

が、やっぱり、メモリーリークというほどの明らかなメモリーの増加は見られない。
もう少し bnavigate2 の中身を工夫しないと駄目か。
あと、trunk以外は試してないので、1.8 でも試してみるか。

|

« [Ruby] Win32OLE のメモリーリーク その5 | トップページ | [Ruby] Win32OLE のメモリーリーク その7 »

コメント

この記事へのコメントは終了しました。

トラックバック


この記事へのトラックバック一覧です: [Ruby] Win32OLE のメモリーリーク その6:

« [Ruby] Win32OLE のメモリーリーク その5 | トップページ | [Ruby] Win32OLE のメモリーリーク その7 »