Git Product home page Git Product logo

Comments (6)

d0rc avatar d0rc commented on July 20, 2024

One more memory leak when using class selector:

==89570== HEAP SUMMARY:
==89570==     in use at exit: 70,276 bytes in 1,402 blocks
==89570==   total heap usage: 98,778 allocs, 97,376 frees, 3,370,092 bytes allocated
==89570==
==89570== 40,960 bytes in 1,024 blocks are definitely lost in loss record 76 of 76
==89570==    at 0x66BB: malloc (in /usr/local/Cellar/valgrind/3.10.1/lib/valgrind/vgpreload_memcheck-amd64-darwin.so)
==89570==    by 0x9A28D: operator new(unsigned long) (in /usr/lib/libc++.1.dylib)
==89570==    by 0x100005727: CParser::parseTypeSelector() (in ./parser)
==89570==    by 0x100004AB7: CParser::parseSimpleSelectorSequence() (in ./parser)
==89570==    by 0x100003C8C: CParser::parseSelector() (in ./parser)
==89570==    by 0x100003654: CParser::parseSelectorGroup() (in ./parser)
==89570==    by 0x1000035D3: CParser::create(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) (in ./parser)
==89570==    by 0x10001503E: CSelection::find(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) (in ./parser)
==89570==    by 0x100002925: CDocument::find(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) (in ./parser)
==89570==    by 0x1000022A3: test_parser() (in ./parser)
==89570==    by 0x1000025B2: main (in ./parser)

from gumbo-query.

d0rc avatar d0rc commented on July 20, 2024

This one became visible after attempt to fix first memory leak like this:

d0rc@6350675

from gumbo-query.

d0rc avatar d0rc commented on July 20, 2024

ecf701b - this fixes valgrind output for example code, but I'm not sure if it's ok in general

from gumbo-query.

TechnikEmpire avatar TechnikEmpire commented on July 20, 2024

The issue becomes apparent when you search the source code for "new" and then search the source code for delete. There's a single "delete" in the code, according to github search. If you look at the parsers and selectors, they all call new, alot. I see nowhere (at a quick glance) where anything is being deleted after.

from gumbo-query.

d0rc avatar d0rc commented on July 20, 2024

@TechnikEmpire there is an Object parent class that seems to be counting refrences.... somehow...

from gumbo-query.

lazytiger avatar lazytiger commented on July 20, 2024

Memory leak problem is solved

from gumbo-query.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.