I keep running out of memory and swapping but having a hard time figuring out what is using so much ram
up vote
0
down vote
favorite
This is what it looks like on top:

To get that free memory I had to kill Android Studio. Chrome is definitely using the most memory, but also Firefox. I keep both open most of the day doing different things. I've been doing that plus Android Studio for years and never had an issue until recently. The only thing I've changed recently is I upgraded to Ubuntu 18.10. I noticed the buff/cache is really high, should it really be using that much when I'm running out of memory for applications and having to swap?
ram 18.10 memory-usage
|
show 8 more comments
up vote
0
down vote
favorite
This is what it looks like on top:

To get that free memory I had to kill Android Studio. Chrome is definitely using the most memory, but also Firefox. I keep both open most of the day doing different things. I've been doing that plus Android Studio for years and never had an issue until recently. The only thing I've changed recently is I upgraded to Ubuntu 18.10. I noticed the buff/cache is really high, should it really be using that much when I'm running out of memory for applications and having to swap?
ram 18.10 memory-usage
You might look at some of the techniques in https://unix.stackexchange.com/questions/253816/restrict-size-of-buffer-cache-in-linux
– Charles Green
Dec 12 at 16:43
Your swap space is too small. And the parameter vm.swappiness may need to be tweaked. The buff/cache is used as file/disk cache when available.
– heynnema
Dec 12 at 17:06
@CharlesGreen thanks for the link, going to play with those values.
– casolorz
Dec 12 at 17:13
@heynnema yeah just noticed that about my swap space, it has been like that for a while but I'll see if I can increase it. Still seems odd that it would prefer to swap rather than free up some ram on the buff/cache.
– casolorz
Dec 12 at 17:14
Hence my comment about tweaking vm.swappiness.
– heynnema
Dec 12 at 17:17
|
show 8 more comments
up vote
0
down vote
favorite
up vote
0
down vote
favorite
This is what it looks like on top:

To get that free memory I had to kill Android Studio. Chrome is definitely using the most memory, but also Firefox. I keep both open most of the day doing different things. I've been doing that plus Android Studio for years and never had an issue until recently. The only thing I've changed recently is I upgraded to Ubuntu 18.10. I noticed the buff/cache is really high, should it really be using that much when I'm running out of memory for applications and having to swap?
ram 18.10 memory-usage
This is what it looks like on top:

To get that free memory I had to kill Android Studio. Chrome is definitely using the most memory, but also Firefox. I keep both open most of the day doing different things. I've been doing that plus Android Studio for years and never had an issue until recently. The only thing I've changed recently is I upgraded to Ubuntu 18.10. I noticed the buff/cache is really high, should it really be using that much when I'm running out of memory for applications and having to swap?
ram 18.10 memory-usage
ram 18.10 memory-usage
asked Dec 12 at 16:31
casolorz
6810
6810
You might look at some of the techniques in https://unix.stackexchange.com/questions/253816/restrict-size-of-buffer-cache-in-linux
– Charles Green
Dec 12 at 16:43
Your swap space is too small. And the parameter vm.swappiness may need to be tweaked. The buff/cache is used as file/disk cache when available.
– heynnema
Dec 12 at 17:06
@CharlesGreen thanks for the link, going to play with those values.
– casolorz
Dec 12 at 17:13
@heynnema yeah just noticed that about my swap space, it has been like that for a while but I'll see if I can increase it. Still seems odd that it would prefer to swap rather than free up some ram on the buff/cache.
– casolorz
Dec 12 at 17:14
Hence my comment about tweaking vm.swappiness.
– heynnema
Dec 12 at 17:17
|
show 8 more comments
You might look at some of the techniques in https://unix.stackexchange.com/questions/253816/restrict-size-of-buffer-cache-in-linux
– Charles Green
Dec 12 at 16:43
Your swap space is too small. And the parameter vm.swappiness may need to be tweaked. The buff/cache is used as file/disk cache when available.
– heynnema
Dec 12 at 17:06
@CharlesGreen thanks for the link, going to play with those values.
– casolorz
Dec 12 at 17:13
@heynnema yeah just noticed that about my swap space, it has been like that for a while but I'll see if I can increase it. Still seems odd that it would prefer to swap rather than free up some ram on the buff/cache.
– casolorz
Dec 12 at 17:14
Hence my comment about tweaking vm.swappiness.
– heynnema
Dec 12 at 17:17
You might look at some of the techniques in https://unix.stackexchange.com/questions/253816/restrict-size-of-buffer-cache-in-linux
– Charles Green
Dec 12 at 16:43
You might look at some of the techniques in https://unix.stackexchange.com/questions/253816/restrict-size-of-buffer-cache-in-linux
– Charles Green
Dec 12 at 16:43
Your swap space is too small. And the parameter vm.swappiness may need to be tweaked. The buff/cache is used as file/disk cache when available.
– heynnema
Dec 12 at 17:06
Your swap space is too small. And the parameter vm.swappiness may need to be tweaked. The buff/cache is used as file/disk cache when available.
– heynnema
Dec 12 at 17:06
@CharlesGreen thanks for the link, going to play with those values.
– casolorz
Dec 12 at 17:13
@CharlesGreen thanks for the link, going to play with those values.
– casolorz
Dec 12 at 17:13
@heynnema yeah just noticed that about my swap space, it has been like that for a while but I'll see if I can increase it. Still seems odd that it would prefer to swap rather than free up some ram on the buff/cache.
– casolorz
Dec 12 at 17:14
@heynnema yeah just noticed that about my swap space, it has been like that for a while but I'll see if I can increase it. Still seems odd that it would prefer to swap rather than free up some ram on the buff/cache.
– casolorz
Dec 12 at 17:14
Hence my comment about tweaking vm.swappiness.
– heynnema
Dec 12 at 17:17
Hence my comment about tweaking vm.swappiness.
– heynnema
Dec 12 at 17:17
|
show 8 more comments
1 Answer
1
active
oldest
votes
up vote
0
down vote
accepted
From the comments...
Your 2G swap space is too small. And the parameter vm.swappiness may need to be tweaked. The buff/cache is used as file/disk cache when available.
You thought the system was using a 22G swap partition, but instead it was using a 2G swapfile. You've enlarged that, and so far it's working well. I'd recommend about a 8G swapfile.
The parameter vm.swappiness can be changed from its default of 60, to 10, to see if that improves the ratio of main memory vs swap and disk/file cache. Edit /etc/sysctl.conf and add vm.swappiness=10, and then reboot.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1100378%2fi-keep-running-out-of-memory-and-swapping-but-having-a-hard-time-figuring-out-wh%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
From the comments...
Your 2G swap space is too small. And the parameter vm.swappiness may need to be tweaked. The buff/cache is used as file/disk cache when available.
You thought the system was using a 22G swap partition, but instead it was using a 2G swapfile. You've enlarged that, and so far it's working well. I'd recommend about a 8G swapfile.
The parameter vm.swappiness can be changed from its default of 60, to 10, to see if that improves the ratio of main memory vs swap and disk/file cache. Edit /etc/sysctl.conf and add vm.swappiness=10, and then reboot.
add a comment |
up vote
0
down vote
accepted
From the comments...
Your 2G swap space is too small. And the parameter vm.swappiness may need to be tweaked. The buff/cache is used as file/disk cache when available.
You thought the system was using a 22G swap partition, but instead it was using a 2G swapfile. You've enlarged that, and so far it's working well. I'd recommend about a 8G swapfile.
The parameter vm.swappiness can be changed from its default of 60, to 10, to see if that improves the ratio of main memory vs swap and disk/file cache. Edit /etc/sysctl.conf and add vm.swappiness=10, and then reboot.
add a comment |
up vote
0
down vote
accepted
up vote
0
down vote
accepted
From the comments...
Your 2G swap space is too small. And the parameter vm.swappiness may need to be tweaked. The buff/cache is used as file/disk cache when available.
You thought the system was using a 22G swap partition, but instead it was using a 2G swapfile. You've enlarged that, and so far it's working well. I'd recommend about a 8G swapfile.
The parameter vm.swappiness can be changed from its default of 60, to 10, to see if that improves the ratio of main memory vs swap and disk/file cache. Edit /etc/sysctl.conf and add vm.swappiness=10, and then reboot.
From the comments...
Your 2G swap space is too small. And the parameter vm.swappiness may need to be tweaked. The buff/cache is used as file/disk cache when available.
You thought the system was using a 22G swap partition, but instead it was using a 2G swapfile. You've enlarged that, and so far it's working well. I'd recommend about a 8G swapfile.
The parameter vm.swappiness can be changed from its default of 60, to 10, to see if that improves the ratio of main memory vs swap and disk/file cache. Edit /etc/sysctl.conf and add vm.swappiness=10, and then reboot.
answered Dec 12 at 20:28
heynnema
17.8k22053
17.8k22053
add a comment |
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1100378%2fi-keep-running-out-of-memory-and-swapping-but-having-a-hard-time-figuring-out-wh%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
You might look at some of the techniques in https://unix.stackexchange.com/questions/253816/restrict-size-of-buffer-cache-in-linux
– Charles Green
Dec 12 at 16:43
Your swap space is too small. And the parameter vm.swappiness may need to be tweaked. The buff/cache is used as file/disk cache when available.
– heynnema
Dec 12 at 17:06
@CharlesGreen thanks for the link, going to play with those values.
– casolorz
Dec 12 at 17:13
@heynnema yeah just noticed that about my swap space, it has been like that for a while but I'll see if I can increase it. Still seems odd that it would prefer to swap rather than free up some ram on the buff/cache.
– casolorz
Dec 12 at 17:14
Hence my comment about tweaking vm.swappiness.
– heynnema
Dec 12 at 17:17