Author Topic: Memory Shortage When Compiling Inside X/qt  (Read 21002 times)

xjqian

  • Sr. Member
  • ****
  • Posts: 497
    • View Profile
    • http://
Memory Shortage When Compiling Inside X/qt
« on: March 08, 2006, 04:45:40 am »
I tried to natively compile a GUI program in X/Qt. However, during the make process, it often popped up a window saying that memory of the workspace was too low (suggesting me to close X/Qt). Frequently X/Qt was automatically shut down due to insufficient memory. Although I did enable 256Mb swap space, it was hardly used by more than half as I monitored.


Anybody had experience with this. Is such a compiling prohibitive in nature due to Z's memory limitation?
My Blog | 6000L Tosa + sled | is: Angstrom | was: pdaXrom 1.1.0beta1 | was: stock 1.12 rom + no-ffpe fash kernel + X/Qt Debian |
CF GPS (FGPCFCD01) | USB "Prolific 2303" GPS (USB-UG-200) | Socket CF BT rev. H |  USB "Pegasus II" Ethernet (ADM8511) | PocketTop IR kbd | sip:527630@fwd.pulver.com
Todo: OESF wiki | stable VOIP app | usable GPS app |      Wishlist: VOIP + Bluetooth | GPS + Routing Calc

qx773

  • Full Member
  • ***
  • Posts: 219
    • View Profile
Memory Shortage When Compiling Inside X/qt
« Reply #1 on: March 08, 2006, 08:09:07 am »
You might have to change the "/etc/fstab" entry for "/tmp" to have it point to some other space, such as SD card, MMC card, or CF card.  By default on the Sharp ROM, the "/tmp" directory is located in RAM.

pgas

  • Hero Member
  • *****
  • Posts: 1097
    • View Profile
    • http://
Memory Shortage When Compiling Inside X/qt
« Reply #2 on: March 08, 2006, 11:10:41 am »
some compilations (especially C++) requires a lot of memory but with a 256MB swap you should be fine in most cases.

Perhaps X/qt only monitor the physical free memory and doesn't take the swap into account?
maybe you should try to compile in a console outside of x/qt
SLC-860 cacko / senao wifi

Meanie

  • Hero Member
  • *****
  • Posts: 2803
    • View Profile
    • http://www.users.on.net/~hluc/myZaurus/
Memory Shortage When Compiling Inside X/qt
« Reply #3 on: March 08, 2006, 11:15:10 pm »
There is a env variable you can set, maybe TMP, cannot remember exactly, which you can use to point it at an alternate tmp location with more space. /tmp is definately not enuff.
SL-C3000 - pdaXii13 build5.4.9 (based on pdaXrom beta3) / SL-C3100 - Sharp ROM 1.02 JP (heavily customised)
Netgear MA701 CF, SanDisk ConnectPlus CF, Socket Bluetooth CF, 4GB Kingston CF,  4GB pqi SD, 4GB ChoiceOnly SD, 2GB SanDisk SD USB Plus, 1GB SanDisk USB Plus, 1GB Transcend SD, 2GB SanDisk MicroSD with SD adaptor, Piel Frama Leather Case, GoldX 5-in-1 USB cable, USB hub, USB mouse, USB keyboard, USB ethernet, USB HDD, many other USB accessories...
(Zaurus SL-C3000 owner since March 14. 2005, Zaurus SL-C3100 owner since September 21. 2005)
http://members.iinet.net.au/~wyso/myZaurus - zBook3K

xjqian

  • Sr. Member
  • ****
  • Posts: 497
    • View Profile
    • http://
Memory Shortage When Compiling Inside X/qt
« Reply #4 on: March 09, 2006, 11:03:30 am »
thanks for the advice. I didn't notice any RAM usage during compilation because I don't have /tmp set in /etc/fstab (I don't even have the fstab in the chrooted environment), maybe I should set it. And I'll try the TMP env variable in X/Qt.

The interesting part right now is that although X/Qt crashed (you can't see the x/qt screen and "your memory is very low, please reboot" warning don't have x/qt in the list anymore), "cc1ql" is still compiling in the backgroud. It's been going for 20hrs now, yes it is a big C++ GUI application I'm trying to compile just for grins.
My Blog | 6000L Tosa + sled | is: Angstrom | was: pdaXrom 1.1.0beta1 | was: stock 1.12 rom + no-ffpe fash kernel + X/Qt Debian |
CF GPS (FGPCFCD01) | USB "Prolific 2303" GPS (USB-UG-200) | Socket CF BT rev. H |  USB "Pegasus II" Ethernet (ADM8511) | PocketTop IR kbd | sip:527630@fwd.pulver.com
Todo: OESF wiki | stable VOIP app | usable GPS app |      Wishlist: VOIP + Bluetooth | GPS + Routing Calc

xjqian

  • Sr. Member
  • ****
  • Posts: 497
    • View Profile
    • http://
Memory Shortage When Compiling Inside X/qt
« Reply #5 on: March 14, 2006, 01:43:02 am »
finally built it. but seg fault
My Blog | 6000L Tosa + sled | is: Angstrom | was: pdaXrom 1.1.0beta1 | was: stock 1.12 rom + no-ffpe fash kernel + X/Qt Debian |
CF GPS (FGPCFCD01) | USB "Prolific 2303" GPS (USB-UG-200) | Socket CF BT rev. H |  USB "Pegasus II" Ethernet (ADM8511) | PocketTop IR kbd | sip:527630@fwd.pulver.com
Todo: OESF wiki | stable VOIP app | usable GPS app |      Wishlist: VOIP + Bluetooth | GPS + Routing Calc

chyang

  • Sr. Member
  • ****
  • Posts: 270
    • View Profile
    • http://mail.ustc.edu.cn/~chyang/
Memory Shortage When Compiling Inside X/qt
« Reply #6 on: March 14, 2006, 03:13:50 am »
Originally, I would set the environment variable TMP to other directory. This works on my C3000.
SL-C3200+Symbol CF WIFI+Corsair 2GB SD
SL-5500+Sharp-3.13 ROM+Viking 512MB CF+Kinston 256MB SD
[img]http://sunsetyang.googlepages.com/c3200.gif\" border=\"0\" class=\"linked-sig-image\" /][img]http://sunsetyang.googlepages.com/5500.gif\" border=\"0\" class=\"linked-sig-image\" /]
Socket CF Bluetooth + EagleTec CF Lan Card + EagleTec CF Modem
Histroy:
[SL-C3000 Cacko 1.23 Beta 1] Sold on 2006/07/27
MA701 CF WIFI + EagleTec CF Bluetooth + D-Link DCF-660W WIFI
[SL5500+Sharp-3.13 ROM+SimpleTech 64MB CF+Hagiwara 128MB SD] Lost on 18,March,04

xjqian

  • Sr. Member
  • ****
  • Posts: 497
    • View Profile
    • http://
Memory Shortage When Compiling Inside X/qt
« Reply #7 on: March 27, 2006, 04:41:44 am »
Inside the chroot env
Code: [Select]
export TMP=/tmp
export TEMP=/temp
which means TMP and TEMP should all be on my CF card. However, this does not stop the annoying memory shortage warning. The behavior is transiant. So I believe that such warning shows up whenever memory usage approachs 64MB limit (i.e.the physical RAM). It's ok if swap speed can catch up with the memory demand at the verge of overflow. Otherwise, X/Qt will crash.
My Blog | 6000L Tosa + sled | is: Angstrom | was: pdaXrom 1.1.0beta1 | was: stock 1.12 rom + no-ffpe fash kernel + X/Qt Debian |
CF GPS (FGPCFCD01) | USB "Prolific 2303" GPS (USB-UG-200) | Socket CF BT rev. H |  USB "Pegasus II" Ethernet (ADM8511) | PocketTop IR kbd | sip:527630@fwd.pulver.com
Todo: OESF wiki | stable VOIP app | usable GPS app |      Wishlist: VOIP + Bluetooth | GPS + Routing Calc

PaulBx1

  • Newbie
  • *
  • Posts: 41
    • View Profile
Memory Shortage When Compiling Inside X/qt
« Reply #8 on: March 31, 2006, 10:09:02 am »
Quote
So I believe that such warning shows up whenever memory usage approachs 64MB limit (i.e.the physical RAM). It's ok if swap speed can catch up with the memory demand at the verge of overflow. Otherwise, X/Qt will crash.

I'm hardly the expert, but I wonder if you reduce the priority of the compile task very low, the system might be able to keep up? That's the "nice" command, right?

Also, do you think it matters where you keep your source and output files? Might be worth moving them around; the different I/O rates could have an effect.

Try compiling something smaller?

Still, these sound like band-aid approaches. The OS should suspend applications automatically while it is keeping the swap situation and memory allocation correct, seems to me. I'm no kernel hacker, though.
SL-C1000 Cacko 1.23 in hand, PDP-11 RT-11 in brain

xjqian

  • Sr. Member
  • ****
  • Posts: 497
    • View Profile
    • http://
Memory Shortage When Compiling Inside X/qt
« Reply #9 on: April 01, 2006, 08:10:40 pm »
Do you know how to use the "nice" command? I'm not an expert either. But I doubt it will help because the memory usage soars only for a short period of time while CPU usage is low. I think that's the period of linkage , right? In my case, seems lots of object files need to be loaded.

my source and output files are all on a 2GB Kingston Elite Pro CF card.

Compiling small programs are all fine. I'm looking into the configure file to tell it not to compile some impractical functionalities.

I think the problem is in the Qt enviroment not in X. So I want to drop into a console to launch X and debian. However, "startx &" didn't call the .xinitrc file. Anybody know how to launch X/Debian from a console?
My Blog | 6000L Tosa + sled | is: Angstrom | was: pdaXrom 1.1.0beta1 | was: stock 1.12 rom + no-ffpe fash kernel + X/Qt Debian |
CF GPS (FGPCFCD01) | USB "Prolific 2303" GPS (USB-UG-200) | Socket CF BT rev. H |  USB "Pegasus II" Ethernet (ADM8511) | PocketTop IR kbd | sip:527630@fwd.pulver.com
Todo: OESF wiki | stable VOIP app | usable GPS app |      Wishlist: VOIP + Bluetooth | GPS + Routing Calc

Da_Blitz

  • Hero Member
  • *****
  • Posts: 1579
    • View Profile
    • http://www.pocketnix.org
Memory Shortage When Compiling Inside X/qt
« Reply #10 on: April 02, 2006, 08:45:40 am »
It might be that the progrom has a hardcoded /tmp and as such you may need to symlink, if it is a tmpfs (ie in ram) then shouldnt it grow into your swap space or was its hardcoded limit half of the physical ram

when in doubt post your /etc/fstab as that will tell us what the maximum size is
Personal Blog
Code
Twitter

Gemini Order: #95 (roughly)
Current Device: Samsung Chromebook Gen 3
Current Arm Devices Count: ~30
Looking to acquire: Cavium Thunder X2 Hardware

ShiroiKuma

  • Hero Member
  • *****
  • Posts: 900
    • View Profile
Memory Shortage When Compiling Inside X/qt
« Reply #11 on: April 05, 2006, 06:48:17 am »
I'm not sure if it's the tmpfs that gets mounted at boot, but am surprised xgjian is the only one complaining about it.

It's not XQt, this is Qtopia's problem, i.e. I get it too during compiling and even when just doing it in console.

The only solution I have identified is open 10 or so progs at the same time. Then watch closely, as soon as the insufficient memory thing pops up, close some other prog.

This works...

But you have to keep closing and opening other programs, opening so that you have something to close when it pops up.

It's really stupid, and for large compilations this doesn't make sense...

If it is the tmp that gets mounted in fstab, then just changing the fstab doesn't work, because it gets mounted by /root/etc/rc.d/rc.rofilesys

So would changing the references to tmpfs in rc.rofilesys work? Putting them on a CF or so?
[span style=\'font-size:8pt;line-height:100%\']Das ganze tschechische Volk ist eine Simulantenbande.[/font][/span]
Militäroberarzt Bautze

Meanie

  • Hero Member
  • *****
  • Posts: 2803
    • View Profile
    • http://www.users.on.net/~hluc/myZaurus/
Memory Shortage When Compiling Inside X/qt
« Reply #12 on: April 05, 2006, 08:32:47 am »
does

export TMPDIR=/mnt/card/tmp

help?

i think the previous variable that was used, TMP, is the wrong one. see if TMPDIR provides more joy
SL-C3000 - pdaXii13 build5.4.9 (based on pdaXrom beta3) / SL-C3100 - Sharp ROM 1.02 JP (heavily customised)
Netgear MA701 CF, SanDisk ConnectPlus CF, Socket Bluetooth CF, 4GB Kingston CF,  4GB pqi SD, 4GB ChoiceOnly SD, 2GB SanDisk SD USB Plus, 1GB SanDisk USB Plus, 1GB Transcend SD, 2GB SanDisk MicroSD with SD adaptor, Piel Frama Leather Case, GoldX 5-in-1 USB cable, USB hub, USB mouse, USB keyboard, USB ethernet, USB HDD, many other USB accessories...
(Zaurus SL-C3000 owner since March 14. 2005, Zaurus SL-C3100 owner since September 21. 2005)
http://members.iinet.net.au/~wyso/myZaurus - zBook3K

ShiroiKuma

  • Hero Member
  • *****
  • Posts: 900
    • View Profile
Memory Shortage When Compiling Inside X/qt
« Reply #13 on: April 05, 2006, 08:50:27 am »
Quote
does

export TMPDIR=/mnt/card/tmp

help?

i think the previous variable that was used, TMP, is the wrong one. see if TMPDIR provides more joy
[div align=\"right\"][a href=\"index.php?act=findpost&pid=121892\"][{POST_SNAPBACK}][/a][/div]
OK, I'll try this one.

I've tried TMP=/mnt/cf/.tmp
and
TEMP=/mnt/cf/.tmp

so far, both have not have had any effect.
[span style=\'font-size:8pt;line-height:100%\']Das ganze tschechische Volk ist eine Simulantenbande.[/font][/span]
Militäroberarzt Bautze

ShiroiKuma

  • Hero Member
  • *****
  • Posts: 900
    • View Profile
Memory Shortage When Compiling Inside X/qt
« Reply #14 on: April 09, 2006, 02:40:42 am »
Quote
does

export TMPDIR=/mnt/card/tmp

help?
[div align=\"right\"][a href=\"index.php?act=findpost&pid=121892\"][{POST_SNAPBACK}][/a][/div]
Confirmed... I've done
Code: [Select]
export TMPDIR=/mnt/card/.tmpand it no longer bombs out.

Thanks for this great tip.
[span style=\'font-size:8pt;line-height:100%\']Das ganze tschechische Volk ist eine Simulantenbande.[/font][/span]
Militäroberarzt Bautze