Linux memory issues resolved?
Marcus Denker
marcus at ira.uka.de
Mon Jan 18 19:23:00 UTC 1999
On Sun, Jan 17, 1999 at 03:34:50PM +0100, Roland Jesse wrote:
> Lex Spoon wrote:
>
> > Try adding the -memory option to your command line.
>
> Is there no way of specifying the heap size at compile time? So far I
in void ParseArguments(int argc, char **argv), file sqXWindow.c
initialHeapSize= 5*1024*1024; /* 5 megabytes by default */
> never submitted the FreeBSD port of 2.3 to the ports collection because it
> should run without specifying any options on the command line.
I have written a squeak-wrapper script that sets some parameters,
and builds up a $HOME/.squeak directory if the user starts squeak
the first time.
I'l change it a bit for 2.3 (e.g I will use the env-vars like
SQUEAK_MEMORY instead of the arguments), but here is the version
I use in my 2.3beta package:
(Mail me if you need man-pages for squeak, squeakvm and squeakvmh.
Not providing man-pages is considered to be a bug in Debian)
------------------------------------------------------------------
#!/bin/sh
#
# Squeak startup script for Debian GNU/Linux
# (c) 1998 Marcus Denker <marcus at ira.uka.de>
#
# This is free software; see the GNU General Public Licence
# version 2 or later for copying conditions. There is NO warranty.
#
#
set -e
version="0.3"
#Directories
SQUEAK_LIB=/usr/share/squeak
SQUEAK_USERDIR=$HOME/.squeak
IMAGE_VERSION="2.3beta"
#Files
SQUEAK_VM=/usr/bin/SqueakVM-2.3beta
SQUEAK_VM_HEADLESS=/usr/bin/SqueakVM-2.3betah
SQUEAK_IMAGE=$SQUEAK_USERDIR/Squeak$IMAGE_VERSION.image
#Standard commandline args
SQUEAK_DEF_ARGS="-lazy -memory 16m"
check_userdir () {
if [ ! -d $SQUEAK_USERDIR ] ; then
new_userdir;
fi;
if [ ! -e $SQUEAK_IMAGE ] ; then
echo "Updating files in .squeak ...."
cp $SQUEAK_LIB/Squeak$IMAGE_VERSION.changes $SQUEAK_LIB/ReadMe.txt $SQUEAK_LIB/Squeak$IMAGE_VERSION.image $SQUEAK_USERDIR
echo "New files installed."
fi;
}
new_userdir () {
echo "No .squeak -- Installing user Files";
mkdir $SQUEAK_USERDIR;
cp $SQUEAK_LIB/Squeak$IMAGE_VERSION.changes $SQUEAK_LIB/ReadMe.txt $SQUEAK_LIB/Squeak$IMAGE_VERSION.image $SQUEAK_USERDIR
ln -s $SQUEAK_LIB/SqueakV2.sources $SQUEAK_USERDIR;
echo "Large .squeak Directory created";
}
print_usage () {
echo "Usage: squeak [<options>] [<imageName>]"
}
print_version () {
echo "Squeak StartUp Script Version $version";
echo "Squeak Version:";
echo "";
SqueakVM-$IMAGE_VERSIONh -version;
}
print_help () {
echo "Usage: squeak [<options>] [<imageName>]
<options> are:
-display <dpy> display on <dpy> (default: $DISPLAY)
-xshm enable X shared memory extensions
-notitle turn off the Squeak window title bar
-fullscreen occupy the entire screen
-lazy go to sleep when main window unmapped
-memory <size>[mk] set initial memory size (default: 5m)
-version print version information, then exit
-headless Start Squeak without X
Notes:
<imageName> defaults to ${SQUEAK_IMAGE}
[options] defaults to ${SQUEAK_DEF_ARGS}"
}
if [ ! $DISPLAY ] ; then echo 'No X $DISPLAY Environment, starting headless
Squeak'; SQUEAK_VM=$SQUEAK_VM_HEADLESS; fi;
# No options
if [ $# = 0 ]; then
check_userdir;
SQUEAK_ARGS="$SQUEAK_DEF_ARGS $SQUEAK_IMAGE";
else
# parse arguments
while [ $# != 0 ]
do
case "$1" in
-help|-h|--help)
print_help; exit 0;;
-v|-version|--version)
print_version; exit 0;;
-lazy) SQUEAK_ARGS="$SQUEAK_ARGS $1";;
-fullscreen) SQUEAK_ARGS="$SQUEAK_ARGS $1";;
-notitle) SQUEAK_ARGS="$SQUEAK_ARGS $1";;
-xshm) SQUEAK_ARGS="$SQUEAK_ARGS $1";;
-display)
shift;
SQUEAK_ARGS="$SQUEAK_ARGS -display $1";;
-memory)
shift;
SQUEAK_ARGS="$SQUEAK_ARGS -memory $1";;
-headless) SQUEAK_VM=$SQUEAK_VM_HEADLESS;;
-?*) echo "unknown Argument: $1" ; print_help; exit 1;;
*) break ;;
esac
shift
done
case "$#" in
0) SQUEAK_ARGS="$SQUEAK_ARGS $SQUEAK_IMAGE";;
1) if [ -f $1 ]; then SQUEAK_ARGS="$SQUEAK_ARGS $1";
else echo "no such file $1"; exit 1;
fi;;
*) echo "need exactly one image filename"; exit 1;;
esac
fi
# finally start Squeak
echo "Starting Squeak";
echo "Parameters: $SQUEAK_ARGS";
$SQUEAK_VM $SQUEAK_ARGS
exit 0;
--
Marcus Denker marcus at ira.uka.de fon at home:(0721)614235 @work:(0721)608-2749
More information about the Squeak-dev
mailing list
|