Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.7] bpo-31692: Add PYTHONSHOWALLOCCOUNT env var #3927

Merged
merged 3 commits into from Oct 17, 2017

Conversation

Projects
None yet
5 participants
@vstinner
Copy link
Member

commented Oct 9, 2017

bpo-31692, bpo-19527:

  • Add a new PYTHONSHOWALLOCCOUNT environment variable, similar to
    the Python 3 "-X showalloccount" option
  • When Python is compiled with COUNT_ALLOCS, the new
    PYTHONSHOWALLOCCOUNT environment variable now has to be set to dump
    allocation counts into stderr on shutdown. Moreover, allocations
    statistics are now dumped into stderr rather than stdout.
  • Add @test.support.requires_type_collecting decorator: skip test if
    COUNT_ALLOCS is defined
  • Fix tests for COUNT_ALLOCS: decorate some methods with
    @requires_type_collecting
  • test_sys.test_objecttypes(): update object type when COUNT_ALLOCS
    is defined

https://bugs.python.org/issue31692

Add PYTHONSHOWALLOCCOUNT env var
bpo-31692, bpo-19527:

* Add a new PYTHONSHOWALLOCCOUNT environment variable, similar to
  the Python 3 "-X showalloccount" option
* When Python is compiled with COUNT_ALLOCS, the new
  PYTHONSHOWALLOCCOUNT environment variable now has to be set to dump
  allocation counts into stderr on shutdown. Moreover, allocations
  statistics are now dumped into stderr rather than stdout.
* Add @test.support.requires_type_collecting decorator: skip test if
  COUNT_ALLOCS is defined
* Fix tests for COUNT_ALLOCS: decorate some methods with
  @requires_type_collecting
* test_sys.test_objecttypes(): update object type when COUNT_ALLOCS
  is defined

@vstinner vstinner requested review from serhiy-storchaka and benjaminp Oct 9, 2017

@serhiy-storchaka serhiy-storchaka changed the title [2.7] Add PYTHONSHOWALLOCCOUNT env var [2.7] bpo-31692: Add PYTHONSHOWALLOCCOUNT env var Oct 9, 2017

@serhiy-storchaka
Copy link
Member

left a comment

Using the requires_type_collecting decorator LGTM. But I don't sure about adding PYTHONSHOWALLOCCOUNT. This looks like a new feature to me.

What if split this PR on two parts? The one fixes issues related to immortal types, the other is about additional output.


.. envvar:: PYTHONSHOWALLOCCOUNT

If set and Python was compiled with ``COUNT_ALLOCS`` defined, Python will

This comment has been minimized.

Copy link
@serhiy-storchaka

serhiy-storchaka Oct 9, 2017

Member

It may be worth to document the changes in Doc/c-api/typeobj.rst too.

This comment has been minimized.

Copy link
@vstinner

vstinner Oct 9, 2017

Author Member

I prefer to keep the description of all environment variables at the same place. I added a reference to the env var in Doc/c-api/typeobj.rst.

@vstinner

This comment has been minimized.

Copy link
Member Author

commented Oct 9, 2017

Serhiy: "... This looks like a new feature to me ..."

I prefer to discuss on the bpo: https://bugs.python.org/issue31692#msg303959

@vstinner vstinner merged commit 7b4ba62 into python:2.7 Oct 17, 2017

4 checks passed

bedevere/issue-number Issue number 31692 found
Details
bedevere/news News entry found in Misc/NEWS.d
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@vstinner vstinner deleted the vstinner:count_allocs_envvar27 branch Oct 17, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.