Coder Social home page Coder Social logo

Memory leak problem about pytrec_eval HOT 3 OPEN

cvangysel avatar cvangysel commented on June 23, 2024
Memory leak problem

from pytrec_eval.

Comments (3)

seanmacavaney avatar seanmacavaney commented on June 23, 2024 4

This fix should take care of the problem! Copies of the qid and docno were not being freed properly.

Line #    Mem usage    Increment   Line Contents
================================================
    79   52.750 MiB   52.750 MiB   @profile
    80                             def runme():
    81                                 
    82   55.148 MiB    2.398 MiB       qrel = load_reference('qrels.txt')
    83  103.582 MiB   48.434 MiB       run = load_candidate('run.txt')
    84                             
    85  104.793 MiB    1.211 MiB       evaluator = pytrec_eval.RelevanceEvaluator(qrel, {'map', 'ndcg'})
    86                             
    87  104.793 MiB    0.000 MiB       N = 100
    88  123.664 MiB    0.000 MiB       for i in range(1,N):
    89  123.664 MiB   18.832 MiB           res = evaluator.evaluate(run)
    90  123.664 MiB    0.000 MiB           del res

from pytrec_eval.

Ricocotam avatar Ricocotam commented on June 23, 2024

Great, I quit this tool for this reason, thanks for fixing it. Just a thing on your PR, it's big, author might not accept it directly. May be consider having several smaller PR for each issue ? Since they are not related

Thanks a lot for this work

from pytrec_eval.

seanmacavaney avatar seanmacavaney commented on June 23, 2024

@Ricocotam I agree in spirit (and it was originally the plan to have multiple PRs), but there's a lot of interdependence between the changes made (e.g., 3 of the 4 rely on the addition of a python wrapper around the extension). @cvangysel will this hold up the PR, and would it help speed up the process if I split them up? I could, but it would be a pain.

from pytrec_eval.

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.