Skip to content

nbresuse reports total Jupyter server memory #13

Closed
@jkleint

Description

@jkleint

It looks like nbresuse is reporting the memory use for the entire server process, including all notebooks.

class MetricsHandler(IPythonHandler):
    def get(self):
        """
        Calculate and return current resource usage metrics
        """
        config = self.settings['nbresuse_display_config']
        cur_process = psutil.Process()
        all_processes = [cur_process] + cur_process.children(recursive=True)
        rss = sum([p.memory_info().rss for p in all_processes])

Is it possible to report memory use for each notebook individually? I don't know anything about jupyter architecture, but maybe there's a way to get a pointer to the calling notebook or PID?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions