Skip to content

The first example in readme not working correctly #249

Closed

Description

@axil

Here's what I get on both windows and linux.

Line #    Mem usage    Increment   Line Contents
================================================
     1   37.754 MiB   37.754 MiB   @profile
     2                             def my_func():
     3   45.195 MiB    7.441 MiB       a = [1] * (10 ** 6)
     4  197.820 MiB  152.625 MiB       b = [2] * (2 * 10 ** 7)
     5   45.449 MiB    0.000 MiB       del b
     6   45.449 MiB    0.000 MiB       return a

I would expect it to show released memory after del b as it is described in the readme file.

Activity

  1. Kyvrel commented on Sep 20, 2019

    @Kyvrel

    meet this event too.
    on Python3.7.4 Linux

  2. added a commit that references this issue on Apr 27, 2020
    53e1e3b
  3. Babarberousse commented on Apr 28, 2020

    @Babarberousse
    Contributor

    Looks like this comes from this commit:
    5fe38da

    Which solved this issue:
    #195

    The increment cannot be negative anymore and is not the sum of all the increments on this line. It is the biggest increment that occured for this line (or 0 if no increment).

    If you want to monitor freed memory you can still look at the Mem usage column. You could also roll back to a version <= 0.54 if you want the old table.

    I also feel like the old table was more intuitive, although it may be useful to add the line occurence count to reduce confusion when dealing with loops. This would also help: #272

    @fabianp : I can implement this last solution if you are okay with it.

  4. fabianp commented on Apr 28, 2020

    @fabianp
    Collaborator

    Yes, please do

  5. added 7 commits that reference this issue on May 9, 2020
    ba9963f
    0bc30a6
    cf24f44
    08df6c5
    30e17fa
    13467b0
    781ac80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions