{"action":"closed","issue":{"url":"https://api.github.com/repos/chrsmithdemos/leveldb/issues/107","labels_url":"https://api.github.com/repos/chrsmithdemos/leveldb/issues/107/labels{/name}","comments_url":"https://api.github.com/repos/chrsmithdemos/leveldb/issues/107/comments","events_url":"https://api.github.com/repos/chrsmithdemos/leveldb/issues/107/events","html_url":"https://github.com/chrsmithdemos/leveldb/issues/107","id":58997592,"number":107,"title":"memory allocated for default env is not deallocated","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":0,"created_at":"2015-02-26T00:42:38Z","updated_at":"2015-02-26T00:42:39Z","closed_at":"2015-02-26T00:42:39Z","body":"```\nWhat steps will reproduce the problem?\n1. create db\n2. delete db\n3. run the program using valgrind.\n\n    Options options_;\n    options_.create_if_missing = true;\n    options_.block_cache = cache_; // uses the default\n    options_.write_buffer_size = 0;\n    Status s = DB::Open(options_, dbRoot, &db_);\n    delete db_;\n\nWhat is the expected output? What do you see instead?\n\nExpected no memory leak.\n\n==605== 512 bytes in 1 blocks are still reachable in loss record 11 of 13\n==605==    at 0x4C274B4: operator new(unsigned long) (vg_replace_malloc.c:287)\n==605==    by 0x79836C2: leveldb::InitDefaultEnv() (in \n/usr/local/maui/lib/libleveldb.so.1)\n==605==    by 0x8968B52: pthread_once (in /lib64/libpthread-2.11.1.so)\n==605==    by 0x7982A26: leveldb::Env::Default() (in \n/usr/local/maui/lib/libleveldb.so.1)\n==605==    by 0x7985FFC: leveldb::Options::Options() (in \n/usr/local/maui/lib/libleveldb.so.1)\n==605==    by 0x4EAFBB1: KVStoreStage::KVStoreStage(char const*) \n(kvstorestage.cxx:44)\n==605==    by 0x4EAFCFF: KVStoreStage::makeStage(std::string const&, \nProperties*) (kvstorestage.cxx:252)\n==605==    by 0x5658525: ClassFactory<Stage>::makeInstance(std::string const&, \nProperties*) (classfactory.hxx:150)\n==605==    by 0x5656945: SedaConfig::instantiate() (sedaconfig.cxx:334)\n==605==    by 0x5658388: SedaConfig::init() (sedaconfig.cxx:215)\n==605==    by 0x464259: main (kvs.cxx:120)\n\nenv.h\nclass Env {\n public:\n  Env() { }\n  virtual ~Env();\n\n  // Return a default environment suitable for the current operating\n  // system.  Sophisticated users may wish to provide their own Env\n  // implementation instead of relying on this default environment.\n  //\n  // The result of Default() belongs to leveldb and must never be deleted.\n  static Env* Default();\n\n\n\nWhat version of the product are you using? On what operating system?\n\n1.5.0, OS Suse Linux 11\n\nPlease provide any additional information below.\n\n\n```\n\n-----\nOriginal issue reported on code.google.com by `gsai2...@gmail.com` on 27 Jul 2012 at 12:38"}}