[Python] python- how to display size of all variables

Discussão em 'Python' iniciado por Stack, Julho 29, 2025.

  1. Stack

    Stack Membro Participativo

    I want to print the memory size of all variables in my scope simultaneously.

    Something similar to:

    for obj in locals().values():
    print sys.getsizeof(obj)


    But with variable names before each value so I can see which variables I need to delete or split into batches.

    Ideas?

    Continue reading...

Compartilhe esta Página