个人工具

UbuntuHelp:UbuntuLTSP/ResolveRamIssues

来自Ubuntu中文

Wikibot讨论 | 贡献2007年12月6日 (四) 10:57的版本

跳转至: 导航, 搜索

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.