OESF | ELSI | pdaXrom | OpenZaurus | Zaurus Themes | Community Links | Ibiblio

IPB

Welcome Guest ( Log In | Register )

2 Pages V   1 2 >  
Reply to this topicStart new topic
> Memory Shortage When Compiling Inside X/qt, How to let X/Qt fully use the swap space
xjqian
post Mar 8 2006, 01:45 AM
Post #1





Group: Members
Posts: 500
Joined: 17-January 04
From: St. Louis, USA
Member No.: 1,478



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?
Go to the top of the page
 
+Quote Post
qx773
post Mar 8 2006, 05:09 AM
Post #2





Group: Members
Posts: 219
Joined: 10-February 04
Member No.: 1,807



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.
Go to the top of the page
 
+Quote Post
pgas
post Mar 8 2006, 08:10 AM
Post #3





Group: Members
Posts: 1,099
Joined: 17-December 03
From: Athens, Greece
Member No.: 1,210



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
Go to the top of the page
 
+Quote Post
Meanie
post Mar 8 2006, 08:15 PM
Post #4





Group: Members
Posts: 2,808
Joined: 21-March 05
From: Sydney, Australia
Member No.: 6,686



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.
Go to the top of the page
 
+Quote Post
xjqian
post Mar 9 2006, 08:03 AM
Post #5





Group: Members
Posts: 500
Joined: 17-January 04
From: St. Louis, USA
Member No.: 1,478



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.
Go to the top of the page
 
+Quote Post
xjqian
post Mar 13 2006, 10:43 PM
Post #6





Group: Members
Posts: 500
Joined: 17-January 04
From: St. Louis, USA
Member No.: 1,478



finally built it. but seg fault mad.gif
Go to the top of the page
 
+Quote Post
chyang
post Mar 14 2006, 12:13 AM
Post #7





Group: Members
Posts: 271
Joined: 19-June 03
From: Beijing,China
Member No.: 156



Originally, I would set the environment variable TMP to other directory. This works on my C3000.
Go to the top of the page
 
+Quote Post
xjqian
post Mar 27 2006, 01:41 AM
Post #8





Group: Members
Posts: 500
Joined: 17-January 04
From: St. Louis, USA
Member No.: 1,478



Inside the chroot env
CODE
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.
Go to the top of the page
 
+Quote Post
PaulBx1
post Mar 31 2006, 07:09 AM
Post #9





Group: Members
Posts: 41
Joined: 26-February 06
Member No.: 9,234



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.
Go to the top of the page
 
+Quote Post
xjqian
post Apr 1 2006, 05:10 PM
Post #10





Group: Members
Posts: 500
Joined: 17-January 04
From: St. Louis, USA
Member No.: 1,478



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?
Go to the top of the page
 
+Quote Post
Da_Blitz
post Apr 2 2006, 04:45 AM
Post #11





Group: Members
Posts: 1,565
Joined: 7-April 05
From: Sydney, Australia
Member No.: 6,806



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
Go to the top of the page
 
+Quote Post
ShiroiKuma
post Apr 5 2006, 02:48 AM
Post #12





Group: Members
Posts: 902
Joined: 22-May 04
Member No.: 3,385



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?
Go to the top of the page
 
+Quote Post
Meanie
post Apr 5 2006, 04:32 AM
Post #13





Group: Members
Posts: 2,808
Joined: 21-March 05
From: Sydney, Australia
Member No.: 6,686



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
Go to the top of the page
 
+Quote Post
ShiroiKuma
post Apr 5 2006, 04:50 AM
Post #14





Group: Members
Posts: 902
Joined: 22-May 04
Member No.: 3,385



QUOTE(Meanie @ Apr 5 2006, 01:32 PM)
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
*

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.
Go to the top of the page
 
+Quote Post
ShiroiKuma
post Apr 8 2006, 10:40 PM
Post #15





Group: Members
Posts: 902
Joined: 22-May 04
Member No.: 3,385



QUOTE(Meanie @ Apr 5 2006, 01:32 PM)
does

export TMPDIR=/mnt/card/tmp

help?
*

Confirmed... I've done
CODE
export TMPDIR=/mnt/card/.tmp
and it no longer bombs out.

Thanks for this great tip.
Go to the top of the page
 
+Quote Post

2 Pages V   1 2 >
Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 28th July 2014 - 04:30 PM