{"action":"created","issue":{"url":"https://api.github.com/repos/tesseract-ocr/tesseract/issues/441","repository_url":"https://api.github.com/repos/tesseract-ocr/tesseract","labels_url":"https://api.github.com/repos/tesseract-ocr/tesseract/issues/441/labels{/name}","comments_url":"https://api.github.com/repos/tesseract-ocr/tesseract/issues/441/comments","events_url":"https://api.github.com/repos/tesseract-ocr/tesseract/issues/441/events","html_url":"https://github.com/tesseract-ocr/tesseract/issues/441","id":183209847,"number":441,"title":"Memory leaks","user":{"login":"Molochnik","id":22855207,"avatar_url":"https://avatars.githubusercontent.com/u/22855207?v=3","gravatar_id":"","url":"https://api.github.com/users/Molochnik","html_url":"https://github.com/Molochnik","followers_url":"https://api.github.com/users/Molochnik/followers","following_url":"https://api.github.com/users/Molochnik/following{/other_user}","gists_url":"https://api.github.com/users/Molochnik/gists{/gist_id}","starred_url":"https://api.github.com/users/Molochnik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Molochnik/subscriptions","organizations_url":"https://api.github.com/users/Molochnik/orgs","repos_url":"https://api.github.com/users/Molochnik/repos","events_url":"https://api.github.com/users/Molochnik/events{/privacy}","received_events_url":"https://api.github.com/users/Molochnik/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2016-10-15T13:30:42Z","updated_at":"2016-10-15T19:04:36Z","closed_at":null,"body":"Hello,\r\nI have just downloaded the latest version and found that there are a lot of leaks after a singe page conversion. They can be easily located using visual leak detector:\r\n1) genericvector.h, line 626 ,   T* new_array = new T[size];\r\n2) params.cpp, line 35,   new tesseract::ParamsVectors();\r\n3) strngs.cpp,  line 32,    STRING_HEADER* new_header = (STRING_HEADER*)(alloc_string(alloc))\r\n4) dawg_cache.cpp, line 100,    new SquishedDawg(fp, dawg_type, lang_, perm_type, dawg_debug_level_);\r\n5)  strngs.cpp,  line 107,    memcpy(AllocData(1, kMinCapacity), \"\", 1);//when called from dawg()\r\n6) dict.cpp, line 190,   static DawgCache *cache = new DawgCache();  // evil global singleton\r\n7) dawg.cpp, line 342, edges_ = (EDGE_ARRAY) memalloc(sizeof(EDGE_RECORD) * num_edges_);\r\n\r\nAll of these leaks have root in \"int TessBaseAPI::Init\" so the single usage of this method cannot do big harm though it doesn't look good. Could anyone correct that?"},"comment":{"url":"https://api.github.com/repos/tesseract-ocr/tesseract/issues/comments/254004311","html_url":"https://github.com/tesseract-ocr/tesseract/issues/441#issuecomment-254004311","issue_url":"https://api.github.com/repos/tesseract-ocr/tesseract/issues/441","id":254004311,"user":{"login":"Molochnik","id":22855207,"avatar_url":"https://avatars.githubusercontent.com/u/22855207?v=3","gravatar_id":"","url":"https://api.github.com/users/Molochnik","html_url":"https://github.com/Molochnik","followers_url":"https://api.github.com/users/Molochnik/followers","following_url":"https://api.github.com/users/Molochnik/following{/other_user}","gists_url":"https://api.github.com/users/Molochnik/gists{/gist_id}","starred_url":"https://api.github.com/users/Molochnik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Molochnik/subscriptions","organizations_url":"https://api.github.com/users/Molochnik/orgs","repos_url":"https://api.github.com/users/Molochnik/repos","events_url":"https://api.github.com/users/Molochnik/events{/privacy}","received_events_url":"https://api.github.com/users/Molochnik/received_events","type":"User","site_admin":false},"created_at":"2016-10-15T19:04:36Z","updated_at":"2016-10-15T19:04:36Z","body":"I tried that before with no effect."}}
{"actor":{"display_login":"Molochnik"}}