[問題] map爆記憶體問題
開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
Linux
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
Boost
問題(Question):
將兩個5.65G的檔案分別塞到兩個map,兩個檔案內分別有幾十萬筆筆資料,
我要保留兩檔案具有相同Key的Value,所以目前是用map 搭配find來完成。
但似乎檔案真的太大了,執行時會出現錯誤。
用小的test case有測過程式,結果是我要的沒錯
想請問一下我這個問題有沒有辦法解決
餵入的資料(Input):
兩個5.65G的檔案
預期的正確結果(Expected Output):
No error!
錯誤結果(Wrong Output):
terminate called after throwing an instance of 'std::bad_alloc'
what(): St9bad_alloc
Aborted
程式碼(Code):(請善用置底文網頁, 記得排版)
http://ideone.com/f6ztxU
補充說明(Supplement):
麻煩大家了 :)
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.113.239.247
→
04/25 13:38, , 1F
04/25 13:38, 1F
→
04/25 13:39, , 2F
04/25 13:39, 2F
→
04/25 14:45, , 3F
04/25 14:45, 3F
→
04/25 15:55, , 4F
04/25 15:55, 4F
→
04/25 15:55, , 5F
04/25 15:55, 5F
推
04/25 17:03, , 6F
04/25 17:03, 6F
→
04/25 17:56, , 7F
04/25 17:56, 7F
→
04/25 17:58, , 8F
04/25 17:58, 8F
→
04/27 16:55, , 9F
04/27 16:55, 9F