Skip to content

Commit

Permalink
Merge pull request #72 from LanderU/71-disable-memory-compaction
Browse files Browse the repository at this point in the history
Disable memory compaction
  • Loading branch information
shuhaowu authored Oct 16, 2023
2 parents 3c2024f + 5c5d211 commit 38089c6
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Unit]
Description=Disable memory compaction
ConditionPathExists=/proc/sys/vm/compact_unevictable_allowed

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/opt/ros2-rt-rpi4/memory-compaction

[Install]
WantedBy=multi-user.target
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

echo 0 | tee /proc/sys/vm/compact_unevictable_allowed
3 changes: 3 additions & 0 deletions image_builder/data/jammy-rt/scripts/phase1-target
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ systemctl enable cpu-frequency
# Disable rt-throttling
systemctl enable rt-throttling

# Disable memory compaction
systemctl enable memory-compaction

# Disable unattended-upgrades
apt remove -y unattended-upgrades

Expand Down

0 comments on commit 38089c6

Please sign in to comment.