Skip to content

Cutting room floor: plotting memusagestat#11

Open
stagnation wants to merge 1 commit intomainfrom
feature/plotting-memusagestat-in-python
Open

Cutting room floor: plotting memusagestat#11
stagnation wants to merge 1 commit intomainfrom
feature/plotting-memusagestat-in-python

Conversation

@stagnation
Copy link
Contributor

No description provided.

@stagnation stagnation force-pushed the feature/plotting-memusagestat-in-python branch 2 times, most recently from ff9b4d6 to 44a55e2 Compare December 5, 2023 13:14
Copy link
Contributor

@moroten moroten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally good. Just some minor stuff.

@@ -0,0 +1,294 @@
# Plotting memusagestat's data

This came up during my preparations for the Bazelcon talk [Dude, where is my RAM?].
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What "This"?

# Plotting memusagestat's data

This came up during my preparations for the Bazelcon talk [Dude, where is my RAM?].
But the investigation and the graphs produced by `memusagestat` did not make the cut for the talk.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace ". But" with "but".

Comment on lines +20 to +22
The plot is often nice but there are few options for how to present the data.
Either by sequential allocation or by linear time,
and the labels are very small.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand this as the existence of the options is a good thing and enough, so the only bad thing is that the labels are small. Is that correct?

Comment on lines +23 to +25
So we want to generate new figures for the same data.

We use `memusage` to profile a `bazel` invocation that runs out of memory
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
So we want to generate new figures for the same data.
We use `memusage` to profile a `bazel` invocation that runs out of memory
So to generate new figures for the same data,
we use `memusage` to profile a `bazel` invocation that runs out of memory

//...
```

And render a plot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
And render a plot
and render a plot

Comment on lines +43 to +45
Note, the x-axis is the number of allocations,
when plotted against time the graph instead looks like a noisy square wave.
Which is interesting in its own right,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Note, the x-axis is the number of allocations,
when plotted against time the graph instead looks like a noisy square wave.
Which is interesting in its own right,
Note that the x-axis is the number of allocations.
When plotted against time the graph instead looks like a noisy square wave,
which is interesting in its own right.


### memusage writes a binary datafile

Glancing at [the code] it is quite straight forward,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Glancing at [the code] it is quite straight forward,
Glancing at [the code] it is quite straight forward

Comment on lines +167 to +169
Some file is missing, this error is often raised when the program itself is missing,
which it is not.
But some other file is.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Some file is missing, this error is often raised when the program itself is missing,
which it is not.
But some other file is.
Some file is missing. This error is often raised when the program itself is missing,
which it is not,
but some other file is.


![single scale stack usage](/img/memusagestat-python-single-scale.png)

[available on github]: github.com/meroton/parse-memusagestat/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bad link. Both relative and non-existing repo.

Comment on lines +277 to +278
Our `memusagestat` parser and plotter is [available on github].
And can draw prettier images:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Our `memusagestat` parser and plotter is [available on github].
And can draw prettier images:
Our `memusagestat` parser and plotter is [available on github]
and can draw prettier images:

@stagnation stagnation force-pushed the feature/plotting-memusagestat-in-python branch 2 times, most recently from b87719e to beed912 Compare December 8, 2023 09:37
Copy link
Contributor

@meroton-benjamin meroton-benjamin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

General notes, you tend to use so, this and but a lot. Try varying this, you can almost always remove So from the beggining of a sentence.

for GNU/Linux 3.2.0, with debug_info, not stripped
```

Aha! This is an interpreted file that wants `ld` to start
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing period

### Compile memusagestat

For good measure we can patch the parsing code in `memusagestat`
to have oracle data for our parser.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When introducing an esoteric concept in a text, such as an oracle, define it or reference it, otherwise the reference will be lost to a significant chunk of the audience

Alternatively use a more common concept (reference data)


This shows each entry in the binary file,
heap, stack, lower 32 bits of the time and the higher,
as well as the joined time within parentheses
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing period

For good measure we can patch the parsing code in `memusagestat`
to have oracle data for our parser.
`memusagestat` comes with `glibc` and can be built with its `make` build system.
We need to do some preparation, to have all the dynamic libraries work well.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In order to have all the dynamic libraries work well we need to do some preparation


`memusage` is a great tool to track all allocations for a program,
this comes to many Linux distributions with `glibc` itself.
So if you need a quick-and-easy allocation tracker `memusage` is the tool for you!
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove initial So

# Captain's Log

Follow the Captain's Odyssey to the best and fastest builds.
This salt-stained log is where he documents the fair sights
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This salt-stained log documents the fair sights...

This salt-stained log is where he documents the fair sights
and obstacles encountered.

This contains information about many auxiliary tools and technologies,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The log contains....

and obstacles encountered.

This contains information about many auxiliary tools and technologies,
and notes on all the moving pieces in the remote execution ecosystem.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as well as

(avoid using and as a conjunction between sentances after using it as a list separator right before)

tags: [linux, glibc, python]
---

`memusage` is a great tool to track all allocations for a program,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see comments on first heading in article

You can read the full document here: [Plotting memusagestat's data].
There are two take-home messages:

* One, is a case-study in building and modifying `glibc` tools for your computer:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either use full sentences (A case study in... and our code that you can leverage to plot...) or an ordered list

  1. A case study in building and modifying
  2. Our code to plot allocations

@stagnation stagnation force-pushed the feature/plotting-memusagestat-in-python branch 2 times, most recently from 6379c27 to 9cbdc67 Compare September 18, 2024 11:44
@stagnation stagnation force-pushed the feature/plotting-memusagestat-in-python branch 3 times, most recently from 35032a9 to 361ae6d Compare October 1, 2024 07:51
@stagnation stagnation force-pushed the feature/plotting-memusagestat-in-python branch from 361ae6d to 2d4c40f Compare October 7, 2024 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants