{"action":"created","issue":{"url":"https://api.github.com/repos/byzhang/leveldb/issues/116","labels_url":"https://api.github.com/repos/byzhang/leveldb/issues/116/labels{/name}","comments_url":"https://api.github.com/repos/byzhang/leveldb/issues/116/comments","events_url":"https://api.github.com/repos/byzhang/leveldb/issues/116/events","html_url":"https://github.com/byzhang/leveldb/issues/116","id":59730299,"number":116,"title":"Using mmap for random reads for TableCache files uses a lot of memory","user":{"login":"GoogleCodeExporter","id":9614759,"avatar_url":"https://avatars.githubusercontent.com/u/9614759?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCodeExporter","html_url":"https://github.com/GoogleCodeExporter","followers_url":"https://api.github.com/users/GoogleCodeExporter/followers","following_url":"https://api.github.com/users/GoogleCodeExporter/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCodeExporter/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCodeExporter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCodeExporter/subscriptions","organizations_url":"https://api.github.com/users/GoogleCodeExporter/orgs","repos_url":"https://api.github.com/users/GoogleCodeExporter/repos","events_url":"https://api.github.com/users/GoogleCodeExporter/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCodeExporter/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/byzhang/leveldb/labels/auto-migrated","name":"auto-migrated","color":"ededed"},{"url":"https://api.github.com/repos/byzhang/leveldb/labels/Priority-Medium","name":"Priority-Medium","color":"ededed"},{"url":"https://api.github.com/repos/byzhang/leveldb/labels/Type-Defect","name":"Type-Defect","color":"ededed"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-04T00:18:00Z","updated_at":"2015-03-04T00:18:01Z","closed_at":"2015-03-04T00:18:00Z","body":"```\nFix db/db_bench.cc to respect open_files -- \nhttp://code.google.com/p/leveldb/issues/detail?id=115 -- and then run a test \nwith a database that has 10,000 files and --cache_size=1G. RSS for the db_bench \nprocess will be greater than 20G because each file used by an entry in the \nTableCache uses 2MB.\n\nGiven that LevelDB uses small files by default, big LevelDB databases will have \nmany files and this is too much memory to use for the table cache. Or is the \nuse of small files by db_bench not the right way to run big LevelDB databases?\n```\n\nOriginal issue reported on code.google.com by `mdcal...@gmail.com` on 14 Sep 2012 at 11:39"},"comment":{"url":"https://api.github.com/repos/byzhang/leveldb/issues/comments/77070849","html_url":"https://github.com/byzhang/leveldb/issues/116#issuecomment-77070849","issue_url":"https://api.github.com/repos/byzhang/leveldb/issues/116","id":77070849,"user":{"login":"GoogleCodeExporter","id":9614759,"avatar_url":"https://avatars.githubusercontent.com/u/9614759?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCodeExporter","html_url":"https://github.com/GoogleCodeExporter","followers_url":"https://api.github.com/users/GoogleCodeExporter/followers","following_url":"https://api.github.com/users/GoogleCodeExporter/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCodeExporter/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCodeExporter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCodeExporter/subscriptions","organizations_url":"https://api.github.com/users/GoogleCodeExporter/orgs","repos_url":"https://api.github.com/users/GoogleCodeExporter/repos","events_url":"https://api.github.com/users/GoogleCodeExporter/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCodeExporter/received_events","type":"User","site_admin":false},"created_at":"2015-03-04T00:18:01Z","updated_at":"2015-03-04T00:18:01Z","body":"```\nMore details on the performance impact from this are in this thread:\nhttps://groups.google.com/forum/?fromgroups=#!topic/leveldb/mkKRKA4XGb0\n\nThe basic problem is that a LevelDB process will try to get as much memory as \npossible as reported by RSS to cache the database in its address space. I don't \nthat is good behavior either for an embedded or a server database.\n```\n\nOriginal comment by `mdcal...@gmail.com` on 18 Sep 2012 at 4:02"}}