Welcome to the Linux Foundation Forum!
apache make httpd cannot allocate memory
tomasr
Posts: 19
I was doing the build step for apache http server, and I kept getting this error saying something could not allocate memory. I did some searching, and I didn't exactly find an answer, but it seems that the problem may have been that my server just didn't have enough memory to execute the make in one go. So I kept on trying, and that seems to have worked (still working on the apache installation).
My question is: do you think the lack of memory was really the problem here? I just setup this virtual dedicated linux server with godaddy. It's the smallest version, economy, but it says it has 1GB of RAM, so I'm surprised.
0
Comments
-
I do not believe this has to do with the amount of RAM, maybe it could be a lack of hard drive space. Without the exact error message we cannot figure out what the true cause was.0
-
It may have run out of memory. With 1GB of RAM for your virtual machine, how much swap space has been allocated?0
-
Looks like you run out of ram.
Compiling software takes much more ram than just using it (usually at least)
Regards0 -
@mfilpot, yeah, I should have written it down. I believe it was an malloc out of memory exception. It didn't really say much else than that. I'm guessing that I have somewhat less than 20GB of free space; that's how much comes with the plan, and I haven't installed anything except for apache.
@Rubberman, not sure how much swap space is allocated. I'll check tonight.
@marc, is that so? It could see compiles requiring a lot of memory to hold all the definitions and trees.
FYI, the installation was successful - happy!0 -
FYI, my swap space appears to be 0 bytes. As I understand it, swap space sort of extends the actual amount of RAM that can be used, and so here I have 0. This implies that my system was attempting to allocate more than 1GB of RAM.
Is there a log file I can check to see how much RAM the system was attempting to allocate at the time that I was running this build?
Here is the /proc/meminfo snapshot.
MemTotal: 1048576 kB
MemFree: 976056 kB
Buffers: 0 kB
Cached: 0 kB
SwapCached: 0 kB
Active: 0 kB
Inactive: 0 kB
HighTotal: 0 kB
HighFree: 0 kB
LowTotal: 1048576 kB
LowFree: 976056 kB
SwapTotal: 0 kB
SwapFree: 0 kB
Dirty: 0 kB
Writeback: 0 kB
AnonPages: 0 kB
Mapped: 0 kB
Slab: 0 kB
PageTables: 0 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
CommitLimit: 0 kB
Committed_AS: 0 kB
VmallocTotal: 0 kB
VmallocUsed: 0 kB
VmallocChunk: 0 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
Hugepagesize: 2048 kB0 -
Rule of thumb: allocate 2x swap to available RAM, at a minimum. So, since you have 1GB RAM, create a swap space or swap file (use the swapon command to do this) of 2GB, at a minimum. You can increase this later if you need.0
-
Thanks, Rubberman. I have learned that I cannot create swap space because I'm using a godaddy virtual dedicated server. http://support.godaddy.com/groups/web-hosting/forum/topic/am-i-allowed-to-setup-swap-disk-on-vps/0
-
You could recompile linux-utils and then you'd be able to create swap spaces on disc
Regards0 -
Well, even if you cannot create a swap partition, you should be able to create a swap file. As reader marc suggested, install/compile the linux-utils package if you need and do not have access to the swapon command in your VM. All you should need is disc space (real or virtual).0
-
If you would like to make a swap parse file you can follow these steps, in this case the swap file is being stored as /root/swapme. (Run all of these commands as root)
# Make a 1GB empty File dd if=/dev/zero of=/root/swapme bs=1M count=1024 # format the file as swap mkswap /root/swapme #To mount it immediately, you can use swapon /root/swapme #To make sure it is always mounted on boot you need to add the following line to /etc/fstab /root/swapme swap swap deafaults 0 0
Call it whatever you want, swapme was a fast name that I used to test the steps.0 -
It appears linux-utils is the same as util-linux, correct?
@mfillpot - thanks, swapon is what I tried at first and it failed. I searched about the error and hit that godaddy support thread that I posted. I still tried changing fstab and rebooting, but doesn't appear to have done anything.0 -
I would assume that the linux-utils and utils-linux are the same, can you pleas tell us what distro you are using so we can confirm the contents?
As for the swapon command, can you please paste the error message or tell us what it does when that command fails?
can you please tell me the steps and errors messages that resulted when you followed by script? I am curious about the naming conventions you use and to verify that your instructions are all pointing to the same source.0 -
Godaddy probable remove the suport for that in it's binaries. That's why I suggested to recompile linux-utils (or util-linux)
Regards0 -
Hello! I got distracted from this for a while, but I'm getting back to it.
I'm looking up the util-linux package to learn what to do,but I have a question that I hope would save me some unnecessarily lost time.
On my server, I have util-linux-ng.i686 rpm package installed (it shows up in yum list installed; it came that way on the machine). So I think I ought to uninstall that package (yum remove), then compile and install the new util-linux (from https://github.com/karelzak/util-linux?) - correct?0 -
See http://en.wikipedia.org/wiki/Util-linux
The util-linux-ng package is a standard package, installed by default on RHEL 6.x and clones. Your server indicates that. Don't bother, unless there is something that you really need from the one you are proposing to install.
0 -
Eh...so I learned how to compile util-linux. Then I figured I'd remove the one from the package manager, and then drop-in my new one. But when I ran yum, it removed everything! Well, it removed a lot of stuff, destroying my ability to sudo or remote terminal.
At the moment, I'm working on getting my machine back to normal, but in the mean time, is there an option or prompt for yum remove that I missed? Also, I suspect many programs may be expecting a certain version of the util-linux files, and therefore fail, but this I'm really uncertain of.0 -
That package has a lot of stuff that other components of the operating system required for most normal use, so it is listed as a dependency in those other packages. As a result, when you removed util-linux, you removed all the dependent stuff as well, resulting in ... well, now you know. This is why yum, as a default, will list what it is going to install or remove and then ask if you want to continue the operation.
Unfortunately there is no quick fix for this except to reinstall the OS. You can install all the removed packages manually, but that will take a LOT longer than a simple reinstall/repair. Some installers will let you repair the installation, re-installing the default package set without munging current configurations of other stuff in /etc for example. In any case, you will have a lot of work to do to get back to where you were.
My recommendation in such cases is not to uninstall the package in question, but to install it in /usr (the default --prefix option for source packages is /usr/local, normally). If that causes problems, then you can fix that with a simple "yum reinstall util-linux" command. That will restore the default system version of those applications and such.0
Categories
- All Categories
- 167 LFX Mentorship
- 219 LFX Mentorship: Linux Kernel
- 795 Linux Foundation IT Professional Programs
- 355 Cloud Engineer IT Professional Program
- 179 Advanced Cloud Engineer IT Professional Program
- 82 DevOps Engineer IT Professional Program
- 127 Cloud Native Developer IT Professional Program
- 112 Express Training Courses
- 112 Express Courses - Discussion Forum
- 6.2K Training Courses
- 48 LFC110 Class Forum - Discontinued
- 17 LFC131 Class Forum
- 35 LFD102 Class Forum
- 227 LFD103 Class Forum
- 14 LFD110 Class Forum
- 39 LFD121 Class Forum
- 15 LFD133 Class Forum
- 7 LFD134 Class Forum
- 17 LFD137 Class Forum
- 63 LFD201 Class Forum
- 3 LFD210 Class Forum
- 5 LFD210-CN Class Forum
- 2 LFD213 Class Forum - Discontinued
- 128 LFD232 Class Forum - Discontinued
- 1 LFD233 Class Forum
- 2 LFD237 Class Forum
- 23 LFD254 Class Forum
- 697 LFD259 Class Forum
- 109 LFD272 Class Forum
- 3 LFD272-JP クラス フォーラム
- 10 LFD273 Class Forum
- 152 LFS101 Class Forum
- 1 LFS111 Class Forum
- 1 LFS112 Class Forum
- 1 LFS116 Class Forum
- 1 LFS118 Class Forum
- LFS120 Class Forum
- 7 LFS142 Class Forum
- 7 LFS144 Class Forum
- 3 LFS145 Class Forum
- 1 LFS146 Class Forum
- 3 LFS147 Class Forum
- 1 LFS148 Class Forum
- 15 LFS151 Class Forum
- 1 LFS157 Class Forum
- 33 LFS158 Class Forum
- 8 LFS162 Class Forum
- 1 LFS166 Class Forum
- 1 LFS167 Class Forum
- 3 LFS170 Class Forum
- 2 LFS171 Class Forum
- 1 LFS178 Class Forum
- 1 LFS180 Class Forum
- 1 LFS182 Class Forum
- 1 LFS183 Class Forum
- 29 LFS200 Class Forum
- 736 LFS201 Class Forum - Discontinued
- 2 LFS201-JP クラス フォーラム
- 14 LFS203 Class Forum
- 102 LFS207 Class Forum
- 1 LFS207-DE-Klassenforum
- 1 LFS207-JP クラス フォーラム
- 301 LFS211 Class Forum
- 55 LFS216 Class Forum
- 48 LFS241 Class Forum
- 42 LFS242 Class Forum
- 37 LFS243 Class Forum
- 15 LFS244 Class Forum
- LFS245 Class Forum
- LFS246 Class Forum
- 50 LFS250 Class Forum
- 1 LFS250-JP クラス フォーラム
- LFS251 Class Forum
- 154 LFS253 Class Forum
- LFS254 Class Forum
- LFS255 Class Forum
- 5 LFS256 Class Forum
- 1 LFS257 Class Forum
- 1.3K LFS258 Class Forum
- 10 LFS258-JP クラス フォーラム
- 111 LFS260 Class Forum
- 159 LFS261 Class Forum
- 41 LFS262 Class Forum
- 82 LFS263 Class Forum - Discontinued
- 15 LFS264 Class Forum - Discontinued
- 11 LFS266 Class Forum - Discontinued
- 20 LFS267 Class Forum
- 24 LFS268 Class Forum
- 29 LFS269 Class Forum
- 1 LFS270 Class Forum
- 199 LFS272 Class Forum
- 1 LFS272-JP クラス フォーラム
- LFS274 Class Forum
- 3 LFS281 Class Forum
- 9 LFW111 Class Forum
- 260 LFW211 Class Forum
- 182 LFW212 Class Forum
- 13 SKF100 Class Forum
- 1 SKF200 Class Forum
- 1 SKF201 Class Forum
- 782 Hardware
- 198 Drivers
- 68 I/O Devices
- 37 Monitors
- 96 Multimedia
- 174 Networking
- 91 Printers & Scanners
- 83 Storage
- 743 Linux Distributions
- 80 Debian
- 67 Fedora
- 15 Linux Mint
- 13 Mageia
- 23 openSUSE
- 143 Red Hat Enterprise
- 31 Slackware
- 13 SUSE Enterprise
- 348 Ubuntu
- 461 Linux System Administration
- 39 Cloud Computing
- 70 Command Line/Scripting
- Github systems admin projects
- 90 Linux Security
- 77 Network Management
- 101 System Management
- 46 Web Management
- 64 Mobile Computing
- 17 Android
- 34 Development
- 1.2K New to Linux
- 1K Getting Started with Linux
- 371 Off Topic
- 114 Introductions
- 174 Small Talk
- 19 Study Material
- 507 Programming and Development
- 285 Kernel Development
- 204 Software Development
- 1.8K Software
- 211 Applications
- 180 Command Line
- 3 Compiling/Installing
- 405 Games
- 309 Installation
- 97 All In Program
- 97 All In Forum
Upcoming Training
-
August 20, 2018
Kubernetes Administration (LFS458)
-
August 20, 2018
Linux System Administration (LFS301)
-
August 27, 2018
Open Source Virtualization (LFS462)
-
August 27, 2018
Linux Kernel Debugging and Security (LFD440)