Skip to content

Commit

Permalink
Use asciinema scripts only
Browse files Browse the repository at this point in the history
  • Loading branch information
carlossvg committed Apr 30, 2022
1 parent 119f55b commit 3c1851e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions minimal_memory_lock/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ Total page faults before spin [Minor: 789, Major: 0]
[WARN] [1651228554.331644228] [minimal_publisher]: New page faults during spin: [minor: 1, major: 0]
```

[![asciicast](https://asciinema.org/a/v43o9lPRoNHXJnA6dBgTgEcdu.svg)](https://asciinema.org/a/v43o9lPRoNHXJnA6dBgTgEcdu)
<script id="asciicast-v43o9lPRoNHXJnA6dBgTgEcdu" src="https://asciinema.org/a/v43o9lPRoNHXJnA6dBgTgEcdu.js" async></script>


Using the `--allocate-in-node` we can simulate the node allocating some memory
on the heap when spinning.

Expand All @@ -85,9 +85,9 @@ Total page faults before spin [Minor: 790, Major: 0]
[WARN] [1651228797.773109372] [minimal_publisher]: New page faults during spin: [minor: 12800, major: 0]
```

[![asciicast](https://asciinema.org/a/cSikCOB9dXNIV3uFujynLZlUg.svg)](https://asciinema.org/a/cSikCOB9dXNIV3uFujynLZlUg)
<script id="asciicast-cSikCOB9dXNIV3uFujynLZlUg" src="https://asciinema.org/a/cSikCOB9dXNIV3uFujynLZlUg.js" async></script>


### Locking the memory

Using the `--lock-memory` option we enforce all the process virtual memory
Expand All @@ -110,9 +110,9 @@ Total page faults before spin [Minor: 20439, Major: 0]
[INFO] [1651229007.707527666] [minimal_publisher]: New page faults during spin: [minor: 0, major: 0]
```

[![asciicast](https://asciinema.org/a/BmCYNbEs101fZcVc77MgC5NGy.svg)](https://asciinema.org/a/BmCYNbEs101fZcVc77MgC5NGy)
<script id="asciicast-BmCYNbEs101fZcVc77MgC5NGy" src="https://asciinema.org/a/BmCYNbEs101fZcVc77MgC5NGy.js" async></script>


In the applications allocate memory dynamically during runtime we may see some
page faults the first time the memory is allocated. After that, because we
are using `MCL_FUTURE` that memory will be locked too.
Expand All @@ -133,9 +133,9 @@ Total page faults before spin [Minor: 20444, Major: 0]
[INFO] [1651229443.395399625] [minimal_publisher]: New page faults during spin: [minor: 0, major: 0]
```

[![asciicast](https://asciinema.org/a/i4dV7qSYqgCmLGKdKO0j1oi1i.svg)](https://asciinema.org/a/i4dV7qSYqgCmLGKdKO0j1oi1i)
<script id="asciicast-i4dV7qSYqgCmLGKdKO0j1oi1i" src="https://asciinema.org/a/i4dV7qSYqgCmLGKdKO0j1oi1i.js" async></script>


One option is to pre-allocate some memory, so we don't get page faults the
first time the memory is allocated in runtime. Using the option
`--memory-preallocation` we can specify the total amount we want to
Expand Down Expand Up @@ -164,9 +164,9 @@ Total page faults before spin [Minor: 35294, Major: 0]
[INFO] [1651229846.717899510] [minimal_publisher]: New page faults during spin: [minor: 0, major: 0]
```

[![asciicast](https://asciinema.org/a/49s48ZK2ZLzpoQAhheq16XXo0.svg)](https://asciinema.org/a/49s48ZK2ZLzpoQAhheq16XXo0)
<script id="asciicast-49s48ZK2ZLzpoQAhheq16XXo0" src="https://asciinema.org/a/49s48ZK2ZLzpoQAhheq16XXo0.js" async></script>


### Tuning the thread stack size

In the previous examples we saw how process memory after locking is
Expand Down Expand Up @@ -194,9 +194,9 @@ Total page faults before spin [Minor: 2228, Major: 0]
[INFO] [1651230229.554856423] [minimal_publisher]: New page faults during spin: [minor: 0, major: 0]
```

[![asciicast](https://asciinema.org/a/WicxfQ7hM52VMqKDfcFgM5LFk.svg)](https://asciinema.org/a/WicxfQ7hM52VMqKDfcFgM5LFk)
<script id="asciicast-WicxfQ7hM52VMqKDfcFgM5LFk" src="https://asciinema.org/a/WicxfQ7hM52VMqKDfcFgM5LFk.js" async></script>


We reduced the total memory used by the process. However, this
configuration should be done for each thread knowing which stack size is
needed. Otherwise, we might see a stack overflow. Some middleware
Expand Down

0 comments on commit 3c1851e

Please # to comment.