File tree 1 file changed +26
-6
lines changed
1 file changed +26
-6
lines changed Original file line number Diff line number Diff line change @@ -4,21 +4,41 @@ title: Post installation guide
4
4
5
5
# Linux SWAP size increase
6
6
7
- TODO
7
+ When compiling the workspace on a machine with multiple cores, the memory gets full quite fast, which leads to freezing of the whole OS.
8
+ One solution is to build with less threads using the ` -j ` compile flag (e.g. ` catkin build -j4 ` )
9
+ Other solution is to increase the size of the swap file, which extends the available memory for the build process.
10
+
11
+ Perform these steps to increase the size of the swap file.
8
12
9
13
``` bash
10
- ~ /git/uav_core/miscellaneous/scripts/set_swap.sh
11
- ```
12
- OR
13
- ``` bash
14
+ # Turn swap off
15
+ # This moves stuff in swap to the main memory and might take several minutes
14
16
sudo swapoff -a
17
+
18
+ # Create an empty swapfile
19
+ # Note that "1M" is basically just the unit and count is an integer.
20
+ # Together, they define the size. In this case 16GiB.
15
21
sudo dd if=/dev/zero of=/swapfile bs=1G count=16
22
+
23
+ # Set the correct permissions
16
24
sudo chmod 600 /swapfile
17
- sudo mkswap /swapfile
25
+
26
+ # Set up a Linux swap area
27
+ sudo mkswap /swapfile
28
+
29
+ # Turn the swap on
18
30
sudo swapon /swapfile
31
+
32
+ # Check if the swap is now the desired size
19
33
grep SwapTotal /proc/meminfo
20
34
```
21
35
36
+ To make the changes permanent (persist on restarts), add this line to the end of your ` /etc/fstab ` :
37
+
38
+ ``` bash
39
+ /swapfile none swap sw 0 0
40
+ ```
41
+
22
42
# Disabling automatic sleep/hibernation
23
43
24
44
TODO
You can’t perform that action at this time.
0 commit comments