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

Optional memory profiler #32959

Closed
marangoz mannequin opened this issue Aug 19, 2000 · 6 comments
Closed

Optional memory profiler #32959

marangoz mannequin opened this issue Aug 19, 2000 · 6 comments
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs)

Comments

@marangoz
Copy link
Mannequin

marangoz mannequin commented Aug 19, 2000

BPO 401229
Nosy @loewis
Files
  • None: None
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2002-07-15.10:25:29.000>
    created_at = <Date 2000-08-19.06:49:39.000>
    labels = ['interpreter-core']
    title = 'Optional memory profiler'
    updated_at = <Date 2002-07-15.10:25:29.000>
    user = 'https://bugs.python.org/marangoz'

    bugs.python.org fields:

    activity = <Date 2002-07-15.10:25:29.000>
    actor = 'loewis'
    assignee = 'jhylton'
    closed = True
    closed_date = None
    closer = None
    components = ['Interpreter Core']
    creation = <Date 2000-08-19.06:49:39.000>
    creator = 'marangoz'
    dependencies = []
    files = ['2727']
    hgrepos = []
    issue_num = 401229
    keywords = ['patch']
    message_count = 6.0
    messages = ['33946', '33947', '33948', '33949', '33950', '33951']
    nosy_count = 3.0
    nosy_names = ['loewis', 'jhylton', 'marangoz']
    pr_nums = []
    priority = 'low'
    resolution = 'rejected'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue401229'
    versions = []

    @marangoz
    Copy link
    Mannequin Author

    marangoz mannequin commented Aug 19, 2000

    No description provided.

    @marangoz marangoz mannequin closed this as completed Aug 19, 2000
    @marangoz marangoz mannequin assigned jhylton Aug 19, 2000
    @marangoz marangoz mannequin added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Aug 19, 2000
    @marangoz marangoz mannequin closed this as completed Aug 19, 2000
    @marangoz marangoz mannequin assigned jhylton Aug 19, 2000
    @marangoz marangoz mannequin added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Aug 19, 2000
    @marangoz
    Copy link
    Mannequin Author

    marangoz mannequin commented Aug 19, 2000

    An optional memory profiler, which goes in tandem with the optional
    object memory allocator (SourceForge patch bpo-101104). The profiler was
    introduced briefly on python-dev:
    http://www.python.org/pipermail/python-dev/2000-August/015239.html

    Applying both patches gives for me (screen dump):

    ~> patch -p1 < ../obmalloc-patch
    patching file [Include/objimpl.h](https://github.com/python/cpython/blob/main/Include/objimpl.h)' patching file Objects/object.c'
    patching file [Objects/obmalloc.c](https://github.com/python/cpython/blob/main/Objects/obmalloc.c)' patching file acconfig.h'
    patching file configure.in' ~> patch -p1 < ../memprof-patch patching file Include/pydebug.h'
    patching file [Modules/Setup.config.in](https://github.com/python/cpython/blob/main/Modules/Setup.config.in)' patching file Modules/main.c'
    patching file [Modules/memprof.c](https://github.com/python/cpython/blob/main/Modules/memprof.c)' patching file Python/pythonrun.c'
    patching file acconfig.h' patching file configure.in'

    • Don't forget that you need to autoheader; autoconf;

    This patch:

    1. introduces a new --with-memprof configure option. Off by default.
    2. introduced a Py_ProfileFlag and a "-p" Python option which starts
      the profiler in Py_Initialize() before any initializations, and stops it
      in Py_Finalize() after all finalizations.
    3. contains a new Modules/memprof.c module. The inclusion of this file
      in the core is similar to the thread and GC modules (Setup.config.in)

    The patch *can* be applied without the object allocator and it *does*
    compile on request. However, it issues a warning that it won't profile
    anything, because it can't be called (the profiler can't install its hooks).
    Besides, it will refuse to start(). The point is that both the profiler and
    the allocator are really optional.

    Needs docs & tests :( The interface can be improved (just like everything
    else) but the core functionality is there. It *is* useful for getting snapshots
    of the minimum allocated (object) memory, at least. Some worthy points to
    condifer, IMO, are listed in the TODO of memprof.c.

    I am submitting this for testing, reviewing, comments and more ideas.
    Overall, I think it is a BIG plus regarding Python's typical introspection.

    Comments welcome. As usual, flames to /dev/null <wink>.

    Status set straight to Postponed. Assigned to marangoz who's in charge of
    opening it in due time, together with bpo-101104.

    @loewis
    Copy link
    Mannequin

    loewis mannequin commented Jun 4, 2001

    Logged In: YES
    user_id=21627

    The patch, in its current form, fails to apply (4 hunks
    fail). Also, the URL of the discussion of the patch
    changed to

    http://mail.python.org/pipermail/python-dev/2000-August/008527.html

    I recommend to reject this patch, since I cannot see what
    use the information it produces has to a Python developer.
    If there is a desire to have the feature in Python, I'd
    volunteer to provide an updated patch.

    @jhylton
    Copy link
    Mannequin

    jhylton mannequin commented Aug 9, 2001

    Logged In: YES
    user_id=31392

    I had the impression that the feature was useful, but
    haven't had any time to spend on it. I'm not sure if
    spending time on it before 2.2 is a good use of time or not.
    I'd rather keep this patch around as a reminder than close
    it, but I'll mark it out of date and give it a low priority.

    @loewis
    Copy link
    Mannequin

    loewis mannequin commented Mar 9, 2002

    Logged In: YES
    user_id=21627

    I still recommend to reject this patch.

    @loewis
    Copy link
    Mannequin

    loewis mannequin commented Jul 15, 2002

    Logged In: YES
    user_id=21627

    I'm closing this patch now. I believe the statistics
    functions of Tim's recent pymalloc changes overlap in
    functionalilty with this patch, and apparently, nobdody has
    a real need for the feature.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    interpreter-core (Objects, Python, Grammar, and Parser dirs)
    Projects
    None yet
    Development

    No branches or pull requests

    0 participants