#17666: False positive for memory leak check on OSX
-------------------------------------+-------------------------------------
       Reporter:  vbraun             |        Owner:
           Type:  defect             |       Status:  needs_info
       Priority:  major              |    Milestone:  sage-6.5
      Component:  algebra            |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Volker Braun       |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/vbraun/false_positive_for_memory_leak_check_on_osx|  
91c2c58feab2a19aafb62621a9f571a2408e86b1
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by jdemeyer):

 Replying to [comment:6 vbraun]:
 > An actual memory leak leaks memory every time...
 Depending on the implementation, that doesn't need to be the case.
 `malloc` usually pre-allocates more memory than strictly needed. Your test
 would pass even if there was an actual memory leak.

 I think a better test would be that the amount of memory needed to execute
 `leak(10000)` n times is bounded by a constant which does not depend on n.
 Something like (pseudocode):
 {{{
 L = []
 for i in range(10):
     leak(10000)
     L.append(memory_usage())
 m = max(L)  # taking the max because the memory usage might increase and
 decrease
 for i in range(10):
     leak(10000)
     assert memory_usage() <= m
 }}}

--
Ticket URL: <http://trac.sagemath.org/ticket/17666#comment:7>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to