Couchbase
  • Why NoSQL?
  • Couchbase Server
  • Download
  • Resources
  • Careers
Home | Forums | SDKs | SDKs

Memory leak in C library

2 replies [Last post]
  • Login or register to post comments
Fri, 01/25/2013 - 05:33
Emiel Bruijntjes
Offline
Joined: 01/21/2013
Groups: None

Valgrind reports that allocated memory does not get removed:

==25320== 192 (176 direct, 16 indirect) bytes in 1 blocks are definitely lost in loss record 200 of 252
==25320== at 0x4C29DB4: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==25320== by 0xB5101BB: lcb_create_libev_io_opts (plugin-libev.c:363)
==25320== by 0x7EC36BD: create_v1 (iofactory.c:232)
==25320== by 0x7EC3843: lcb_create_io_ops (iofactory.c:205)

Is there a counterpart for the lcb_create_io_ios() function that should be called to free() the allocated memory that I am not aware of?

Top
  • Login or register to post comments
Fri, 01/25/2013 - 19:46
trond
trond's picture
Offline
Joined: 03/15/2010
Groups: None

If you manually create an io ops structure you should call the destructor on the io ops when you're done using it (it is part of the io-ops structure)

Top
  • Login or register to post comments
Mon, 01/28/2013 - 01:57
Emiel Bruijntjes
Offline
Joined: 01/21/2013
Groups: None

Thanks for your answer. It turns out that there is a lcb_destroy_io_ops() function that I found in a .h file and that I missed (maybe overlooked) on the website.

Calling it solves the memory leak.

Top
  • Login or register to post comments
  • Login or register to post comments
  • Login
  • Register

Company

  • About Us
  • Leadership
  • Customers
  • Partners
  • Contact Us

Product

  • Couchbase Server
  • Couchbase SDKs
  • Use Cases
  • Documentation
  • Forums

Open Source

  • Couchbase Project
  • Couchbase vs. CouchDB

Commercial

  • Subscriptions & Support
  • Training & Services

News

  • Blog
  • Newsletter
  • Press Releases
  • Buzz

Follow Us

    
  • Customer Login
  • Terms of Service
  • Privacy Policy
  • Trademark Policy
  • Site Map

© 2013 COUCHBASE All rights reserved.

Sign in to Couchbase Community

close
  • Create new account
  • Request new password
You are logging into the Forums, Wiki and Issue Tracker