RAM usage on fresh install of debian

So I have 2 VPS and I installed debian on both of them.

One VPS is using roughly 10mb right after the install, and the other is using 30mb. I'm just wondering why this is (both are minimal).

16 Replies

Did you perhaps install 32-bit Debian on one and 64-bit on the other?

Nope, they were both the same.

Ok so I just tried this out with a 32 bit and 64 bit install of Debian Lenny. Both took roughly the same amount of RAM with a fresh install, but I've seen the number a lot lower. Mine was around 30mb whereas I've seen it around 5mb. Why is this?

@sneaks:

So I have 2 VPS and I installed debian on both of them.

One VPS is using roughly 10mb right after the install, and the other is using 30mb. I'm just wondering why this is (both are minimal).

Look at the output of top (then hit F n) to see why. Also, http://www.linuxatemyram.com/.

Thanks for the link. So is there a way to tell exactly how much memory is actually being used?

Run the command "free" and read the numbers on the middle line (-/+ buffers/cache)

If that's true then I'm back to square one since those are the numbers I have been reading. Running that command in my tests showed some with 30mb used on a fresh install while others had only like 5mb.

@sneaks:

Thanks for the link. So is there a way to tell exactly how much memory is actually being used?

yes, use top. hit F n to sort by memory use, then examine the top, say, 10 entries.

Although, top can be misleading, because it doesn't really give you the full story as far as shared memory among processes.

This script:

http://www.pixelbeat.org/scripts/ps_mem.py

attempts to do that. (I may have found out about it on this forum but I don't recall…)

Thanks, that tool seems pretty nifty. Is it possible though, that 2 fresh minimal installs of Debian 5 both take up significantly different amounts of RAM (ignoring the architecture)?

@sneaks:

One VPS is using roughly 10mb right after the install, and the other is using 30mb.
Could just be the time factor – maybe a cron job happened to kick in just before you looked at the ram usage on one of them, or there was some other relatively normal activity that lead to a bit of caching.

ps, htop and your logs should all help, if you want to see what actually happened (probably a bit late now though, unless you want to start the experiment all over again…).

Make sure you're using the same kernel on both.

Also, they're probably on different hosts, and different hosts may have different kernels and xen versions, which theoretically may influence RAM usage inside the VM.

Yeah, they are on different hosts. How would the kernel and xen make a difference in this? I do believe you, but I'm just curious as to why they matter.

Kernels use RAM to run just like any other process – there's nothing fundamentally magic about a kernel except that it runs at a different privilege level. Different kernel versions may use different amounts of RAM for the same reason different versions of any other program might -- something changed. Maybe an internal buffer was extended, maybe there are new functions, maybe one has additional drivers/features compiled in that the other doesn't.

The Xen version of the host is less likely to cause dramatic changes, but it could have a similar influence. Maybe newer virtualized hardware passes more information to the child kernel's drivers; maybe there are features and optimizations that can be used on one combination of child and host versions but not on another; there are other, deeper/more obscure oddities possible.

You'll see similar discrepancies if you run a kernel on many different combinations of real hardware. Code is going to allocate different amounts of RAM in different situations.

I see, that does make sense. Seems like the most viable explanation of what I'm seeing then. Thanks!

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct