{"action":"created","issue":{"url":"https://api.github.com/repos/chrsmithdemos/leveldb/issues/122","labels_url":"https://api.github.com/repos/chrsmithdemos/leveldb/issues/122/labels{/name}","comments_url":"https://api.github.com/repos/chrsmithdemos/leveldb/issues/122/comments","events_url":"https://api.github.com/repos/chrsmithdemos/leveldb/issues/122/events","html_url":"https://github.com/chrsmithdemos/leveldb/issues/122","id":58997620,"number":122,"title":"util/env_poisx.cc : NewRandomAccessFile()   mmap  Cannot allocate 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/chrsmithdemos/leveldb/labels/auto-migrated","name":"auto-migrated","color":"ededed"},{"url":"https://api.github.com/repos/chrsmithdemos/leveldb/labels/Priority-Medium","name":"Priority-Medium","color":"ededed"},{"url":"https://api.github.com/repos/chrsmithdemos/leveldb/labels/Type-Defect","name":"Type-Defect","color":"ededed"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-02-26T00:42:51Z","updated_at":"2015-02-26T00:42:52Z","closed_at":"2015-02-26T00:42:51Z","body":"```\nWhat steps will reproduce the problem?\n1. block size: 2M.  write buffer size: 256M  kTargetFileSize: 256M\n2. 3.4 million data (each 100k) insert. each time insert 100 data.\n\nWhat is the expected output? What do you see instead?\n\nIn util/env_poisx.cc : NewRandomAccessFile()\n\nvoid* base = mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0);\nafter 3 million data (each 100k) insert. The errno says Cannot allocate memory.\nBut system has enough memory.\n\nWhat version of the product are you using? On what operating system?\nversion is 1.5.\nx86_64 GNU/Linux  red hat\n\nPlease provide any additional information below.\n\ntop:\n\n PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                         \n19794 root      20   0  290g 4.9g 4.7g S 98.6  7.8   2348:00 ldb\n\nfree -m:\n\n             total       used       free     shared    buffers     cached\n\nMem:         64350      60623       3726          0        179      59353\n\n-/+ buffers/cache:       1090      63259\n\nSwap:          996          0        996\n\n\nulimit -a:\n\ncore file size          (blocks, -c) unlimited\ndata seg size           (kbytes, -d) unlimited\nfile size               (blocks, -f) unlimited\npending signals                 (-i) 1024\nmax locked memory       (kbytes, -l) 32\nmax memory size         (kbytes, -m) unlimited\nopen files                      (-n) 204800\npipe size            (512 bytes, -p) 8\nPOSIX message queues     (bytes, -q) 819200\nstack size              (kbytes, -s) 10240\ncpu time               (seconds, -t) unlimited\nmax user processes              (-u) 530432\nvirtual memory          (kbytes, -v) unlimited\nfile locks                      (-x) unlimited\nsysctl:\n\nvm.max_map_count = 300000\nkernel.shmmni = 8092\nkernel.shmall = 4194304\nkernel.shmmax = 2147483648\n\n```\n\n-----\nOriginal issue reported on code.google.com by `ewouldbl...@gmail.com` on 1 Oct 2012 at 2:13"},"comment":{"url":"https://api.github.com/repos/chrsmithdemos/leveldb/issues/comments/76099606","html_url":"https://github.com/chrsmithdemos/leveldb/issues/122#issuecomment-76099606","issue_url":"https://api.github.com/repos/chrsmithdemos/leveldb/issues/122","id":76099606,"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-02-26T00:42:52Z","updated_at":"2015-02-26T00:42:52Z","body":"```\nFixed in 1.6.0.  We mmap a max of 1000 files, which at least with the default \nfile size of 2MB should limit memory usage.  If somebody is going to edit the \nleveldb source code to make much bigger files (say 256MB like in this report), \nthey may need to make a corresponding edit to env_posix.cc to reduce the 1000 \nfile limit.\n\n```\n\n-----\nOriginal comment by `san...@google.com` on 12 Oct 2012 at 7:55\n* Changed state: **Fixed**"}}