![]() |
/tmp goes to 100% on compile of opencv
As the title states.
Some info. Error messages on failure: Code:
CMake Error at data/cmake_install.cmake:36 (FILE):Quote:
How do I increase the size of /tmp ? I have enough disk space as far as I know. |
It looks like you have your /tmp in "tmpfs" i.e. in your RAM (possibly because you thought that would speed up compilations, which it will). However, when setting up a tmnpfs in memory, maximally half of your RAM is allocated to the tmpfs by default. That sounds like a lot but if other processes also require the use of RAM, you may end up with a tmpfs which is too small to be useable.
As you can see you have 1.5 GB of tmpfs and it has all been consumed by your /tmp mount. If you make /tmp a directory in your root filesystem, then you will have 12 GB of free space for compilations. Eric |
There is an issue with the way that OpenCV is compiled by default in that it uses precompiled headers, which aren't of much use in SlackBuilds. If you add the following to the cmake options, the amount of disk space required will be reduced by about 2GB and your tmp partition will not fill up:
Code:
-DENABLE_PRECOMPILED_HEADERS=OFF |
I think that putting /tmp in RAM for general use in laptops and desktops has to be classified under "seemed like a good idea at the time". As AlienBob says, you will achieve brilliant performance a few times, but then for the rest of the time that memory will be wasted. Simply leaving it for the O/S to decide what's best to use it for (ie caching reads/writes) is probably a better idea. But that's just my opinion. I wont deny that under certain server workloads, it may well be a good idea to use /tmp in RAM though !
|
bosth,
I edited the slackbuild script, and added the line you suggested. Now I get an error saying the build dir is does not exist. It does, how ever there is nothing in the dir. The error: Quote:
Quote:
I also understand the need to move /tmp onto the hard drive, so I don't run out of space. However, the how-to's I found talk about making a separate partition for /tmp. Is that necessary? Is there a way to edit /etc/fstab and stop /tmp from mounting to tmpfs, and simply mount to a directory? tmpfs has always confused me. My current fstab. Quote:
|
Quote:
|
Quote:
|
@TobiSGD - That's pretty much my point - you, the user, has to decide what should be left or deleted from /tmp if you want to keep real memory usage low. At my work, we run a mix of Solaris and Slackware servers. With Solaris, /tmp by default is in virtual memory. As a rule, we tend to code around that and use another directory as "tmp". On occasion we've hit memory issues, as a result of /tmp filling up - waiting to reboot is a bad idea as we tend to only reboot our servers when the diesel power generators need to be tested - ie every 6 months. For the Slackware servers, I setup /tmp to be on disk and I never ever have issues. So if you don't reboot frequently, then one has to write scripts to monitor usage of /tmp and delete (carefully) where files are old. My general feeling is that the odd performance issue you benefit from does not outweigh the downsides of /tmp in RAM. But again, that's an opinion. I strongly suspect that Pat's box that rebuilds Slackware from source would strongly benefit from that - possibly to the point where to not use it would be unfeasible.
|
Update, I refreshed the opencv.SlackBuild, and carefully added the line bosth suggested. I ran the the slackbuild, and oopencv built this time using only about 22% OF /tmp.
I will do some more investigating on having /tmp on disk, instead of ram. Original problem (opencv not building) solved. Thank-you to every one who contributed. Merry Christmas to everyone. |
| All times are GMT -5. The time now is 10:51 PM. |