PlaneShift

Development => Development Deliberation => Topic started by: Tulkhan on November 11, 2007, 05:05:03 pm

Title: psclient memory usage (was: Nvidia Cg toolkit a definitive requirement?)
Post by: Tulkhan on November 11, 2007, 05:05:03 pm
Hi all,

 I've been using the official Linux release packages on a FreeBSD box, since PS 0.3.016, without
any trouble so far.  However, the .020 release is very unstable for me, probably related to CS
lighter2 usage? I'm frequently crashing on the lighter2 maps with errors like this:

*** glibc detected *** ./psc: double free or corruption (!prev): 0x08d50ef8
***
======= Backtrace: =========
/lib/obsolete/linuxthreads/libc.so.6[0x29164200]
/lib/obsolete/linuxthreads/libc.so.6(__libc_free+0x63)[0x2916472f]
libs/libstdc++.so.6(_ZdlPv+0x21)[0x290c31b1]
libs/libstdc++.so.6(_ZdaPv+0x1d)[0x290c320d]
./psc[0x868e72d]
======= Memory map: ========

So I tried building a native client on FreeBSD, which went pretty well.  Unfortunately, the Nvidia Cg
toolkit isn't available for FreeBSD, which PlaneShift now seems to require.  Is there a way to disable this?
I could live with less fancy graphics.  With --fullbright, I can load the non-lighter2 maps, but no success
with Hydlaa plaza et al.

Cheers,
-tulkhan
Title: Re: Nvidia Cg toolkit a definitive requirement?
Post by: Caarrie on November 11, 2007, 05:13:41 pm
you mean a tar.gz that can work on any linux distro does not work for you?

http://developer.nvidia.com/object/cg_toolkit.html
Title: Re: Nvidia Cg toolkit a definitive requirement?
Post by: Tulkhan on November 11, 2007, 05:21:48 pm
you mean a tar.gz that can work on any linux distro does not work for you?

 No, FreeBSD isn't a Linux distro  ;)

 There is an ABI layer (called the "Linuxolator") to run Linux binaries, but it's not possible
to have native FreeBSD programs loading Linux libraries.
Title: Re: Nvidia Cg toolkit a definitive requirement?
Post by: ThomPhoenix on November 12, 2007, 12:07:47 am
Perhaps someone can help you on the Crystal Space front.
Title: Re: Nvidia Cg toolkit a definitive requirement?
Post by: Tulkhan on November 12, 2007, 10:19:26 am
Perhaps someone can help you on the Crystal Space front.

Ok, thanks, will try that.

Cheers,
-tulkhan
Title: psclient memory usage
Post by: Tulkhan on November 13, 2007, 06:50:47 pm
With the help of a CS developer (http://www.crystalspace3d.org/forum/index.php/topic,1510.0.html) I've been able to track down the problem.  The Cg shaders aren't the issue at all;
CS will fall back to other shaders if Cg isn't available.

Instead, my problem is/was with RAM usage.  FreeBSD imposes, per default, a per process data size limit of 512M.
With this in place, psclient crashes upon loading world with a GCC exception (bad_alloc), which is thrown if new()
fails to allocate memory for some reason.

If I raise the data size limit to 768M (I have "only" 1G RAM), I can login fine, but only on the "old" maps that are
not lighter2-lit.  Even on the old plaza map (from .019) psclient consumes 576M, and if I try logging in on the new
lighter2 map, memory usage grows to over 770M until it eventually crashes again.

Is there something fishy going on with my CS/Planeshift build that makes it consume that much memory or does
Planeshift really need that much memory with the CS 1.2 engine now in place?

BTW, the Linux client uses 660M on the plaza map, with the old plaza map from .019 it's only 448M, which would
be a possible explanation for my instability problems with .020 (see first post).

Title: Re: psclient memory usage (was: Nvidia Cg toolkit a definitive requirement?)
Post by: Vornne on November 14, 2007, 07:43:13 am
Just to confirm the previous post, I run 64 bit linux with 1GB memory, and from my testing of the .020 release, lighter2 maps take up around 200 more MB of RAM than the old type.
Title: Re: psclient memory usage (was: Nvidia Cg toolkit a definitive requirement?)
Post by: Induane on November 18, 2007, 05:12:08 am
Yes its due to the lightmaps being stored as png images, I wonder if lighter2 could handle converting those to .dds fies at some point. That might help.
Title: Re: psclient memory usage (was: Nvidia Cg toolkit a definitive requirement?)
Post by: Xordan on November 18, 2007, 07:54:47 am
I'm currently working on some memory problems in CS, hopefully we'll be able to cut down the average memory usage a fair bit.
Title: Re: psclient memory usage (was: Nvidia Cg toolkit a definitive requirement?)
Post by: Tulkhan on November 18, 2007, 04:03:26 pm
I'm currently working on some memory problems in CS, hopefully we'll be able to cut down the average memory usage a fair bit.

That's good to know. And thanks for your work Xordan!