个人工具

“UbuntuHelp:UbuntuLTSP/ResolveRamIssues”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
(新页面: {{From|https://help.ubuntu.com/community/UbuntuLTSP/ResolveRamIssues}} {{Languages|UbuntuHelp:UbuntuLTSP/ResolveRamIssues}} '''Note: This has been tested in Ubuntu Feisty. Gutsy contains ...)
 
第13行: 第13行:
 
<pre><nowiki>
 
<pre><nowiki>
 
XRAMPERC=${XRAMPERC:-100}
 
XRAMPERC=${XRAMPERC:-100}
 
 
if [ ${XRAMPERC} -lt 100 ]; then
 
if [ ${XRAMPERC} -lt 100 ]; then
 
XMEM=0
 
XMEM=0
第24行: 第23行:
 
done < /proc/meminfo
 
done < /proc/meminfo
 
XMEM=$((${XMEM} * ${XRAMPERC} / 100))
 
XMEM=$((${XMEM} * ${XRAMPERC} / 100))
 
 
ulimit -v ${XMEM}
 
ulimit -v ${XMEM}
 
fi
 
fi

2007年11月30日 (五) 21:52的版本

Note: This has been tested in Ubuntu Feisty. Gutsy contains a workaround already - you can use the variable already present.

Firefox under LTSP (Feisty) seems to crash when browsing graphics intensive pages. This is due to the fact that Firefox caches pixmaps locally (on the thin-client), and eventually consumes 100%, crashing the X session. The user is directed back to the login manager at this point.

The following workaround should help alleviate this issue, causing applications in X consuming more than 80% of total thin-client memory to exit, without crashing the entire session.


1) Create a $CHROOT/etc/ltsp/screen.d/ directory
2) Copy $CHROOT/usr/lib/ltsp/screen.d/ldm to this new directory, overriding the original
3) Insert the following code before the last (exec ldm ...) line:

XRAMPERC=${XRAMPERC:-100}
if [ ${XRAMPERC} -lt 100 ]; then
XMEM=0
while read TYPE VALUE UNITS; do
case ${TYPE} in
MemFree:|SwapFree:)
XMEM=$((${XMEM} + ${VALUE}))
;;
esac
done < /proc/meminfo
XMEM=$((${XMEM} * ${XRAMPERC} / 100))
ulimit -v ${XMEM}
fi



4) Edit the $CHROOT/etc/lts.conf and add the following line:

XRAMPERC=80


5) Reboot your thin-clients.

This workaround will cause Firefox to crash (with no warning), but will not lock the entire X session.

Apparently, Firefox 3 will have actual fixes and optimization capabilities for thin-client environments such as LTSP.