Just a curious question

Does anyone elses SDL app run much faster as root? All Im doing is creating a
single surface and doing a direct access to the surface to draw some pixels.
The surface is just created using SDL_SWSURFACE so it should be in system mem.
Heres some averages for the user and the root running from TOP. Also when I
run it as root, the memory the program uses goes from 3megs to 36 megs, whys
this?

PID USER PRI NI SIZE RSS SHARE STAT LIB %CPU %MEM TIME COMMAND
347 mongoose 11 0 3312 3312 1904 R 0 63.0 2.5 0:08 ProjectX
184 root 4 0 49924 48M 3180 R 0 34.0 38.9 0:44 X

PID USER PRI NI SIZE RSS SHARE STAT LIB %CPU %MEM TIME COMMAND
358 root 13 0 36088 35M 2016 R 0 71.7 28.1 0:07 ProjectX
184 root 4 0 49300 48M 3184 R 0 25.4 38.4 0:54 X

-Garrett, WPI student majoring in Computer Science.

“He who joyfully marches in rank and file has already earned
my contempt. He has been given a large brain by mistake, since
for him the spinal cord would suffice.” -Albert Einstein

Does anyone elses SDL app run much faster as root? All Im doing is creating a
single surface and doing a direct access to the surface to draw some pixels.
The surface is just created using SDL_SWSURFACE so it should be in system mem.
Heres some averages for the user and the root running from TOP. Also when I
run it as root, the memory the program uses goes from 3megs to 36 megs, whys
this?

This is very strange. Is the application running fullscreen?
If so, it can memory map the video memory (which shows up as app memory)
and set the MTRR range.

-Sam Lantinga				(slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec

Nope, its running in a 640x480 window both times. When running as
root, when my app returns at the very end of the program when I exit, I get the
message
video memory protecting
printed out into the console.

-Garrett, WPI student majoring in Computer Science.

“He who joyfully marches in rank and file has already earned
my contempt. He has been given a large brain by mistake, since
for him the spinal cord would suffice.” -Albert EinsteinOn Fri, 06 Aug 1999, you wrote:

Does anyone elses SDL app run much faster as root? All Im doing is creating a
single surface and doing a direct access to the surface to draw some pixels.
The surface is just created using SDL_SWSURFACE so it should be in system mem.
Heres some averages for the user and the root running from TOP. Also when I
run it as root, the memory the program uses goes from 3megs to 36 megs, whys
this?

This is very strange. Is the application running fullscreen?
If so, it can memory map the video memory (which shows up as app memory)
and set the MTRR range.

Nope, its running in a 640x480 window both times.

Can you verify that the app is actually using that much memory.
I don’t have any explanation…

When running as
root, when my app returns at the very end of the program when I exit, I get the
message
video memory protecting
printed out into the console.

This is a message from the X DGA libraries. It will be gone in the latest
version of DGA.

-Sam Lantinga				(slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec

Hmmm, heres ps m if it means anything
PID TTY MAJFLT MINFLT TRS DRS SIZE SWAP RSS SHRD LIB DT COMMAND
1448 p0 554 633 32 3284 3316 0 3316 1904 0 653 ProjectX

PID TTY MAJFLT MINFLT TRS DRS SIZE SWAP RSS SHRD LIB DT COMMAND
1453 p0 582 641 32 36056 36088 0 36088 2016 0 658 ./ProjectX

Dunno where else to get memory info, and stepping through the program, about 30
megs of memory is allocated at the function
SDL_Init(SDL_INIT_VIDEO);

-Garrett, WPI student majoring in Computer Science.

“He who joyfully marches in rank and file has already earned
my contempt. He has been given a large brain by mistake, since
for him the spinal cord would suffice.” -Albert EinsteinOn Fri, 06 Aug 1999, you wrote:

Nope, its running in a 640x480 window both times.

Can you verify that the app is actually using that much memory.
I don’t have any explanation…

Just another note, when I run the SDL demos they too seem allocate and extra
30 megs of memory when running as root. How do I compile the SDL libraries with
debugging info so GDB (actually ddd which uses gdb) can debug into them?

-Garrett, WPI student majoring in Computer Science.

“He who joyfully marches in rank and file has already earned
my contempt. He has been given a large brain by mistake, since
for him the spinal cord would suffice.” -Albert Einstein

Just another note, when I run the SDL demos they too seem allocate and extra
30 megs of memory when running as root. How do I compile the SDL libraries with
debugging info so GDB (actually ddd which uses gdb) can debug into them?

make debug=true

-Sam Lantinga				(slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec

step
step
step
step
step
step
uh, oh anways, after stepping through many lines of code… I found the line
thats alocating the ~32 megs of memory.

XF86DGAGetVideo(SDL_Display, SDL_Screen,
&unused_ptr, &unused_int, &unused_int, &total_mem);
which is in line 157 of src/linux/x11/SDL_sysvideo.c

I don’t know much about the DGA or xlib functions and what they’re doing so
theres not much else I can say.

-Garrett, WPI student majoring in Computer Science.

“He who joyfully marches in rank and file has already earned
my contempt. He has been given a large brain by mistake, since
for him the spinal cord would suffice.” -Albert Einstein

heh yep, I just bought my Xentor 32 the other day. Its a 2D/3D combo card so
you can use all 32 megs of memory in regular 2D mode. So its not really
allocating 32 megs of system memory?

-Garrett, WPI student majoring in Computer Science.

“He who joyfully marches in rank and file has already earned
my contempt. He has been given a large brain by mistake, since
for him the spinal cord would suffice.” -Albert EinsteinOn Sun, 08 Aug 1999, you wrote:

My guess is that the XF86DGAGetVideo() call does some kind of memory
mapping of the viedomemory ( don’t know that much about DGA/X but
that’s how it works in DOS, hehe ), and hence the memory usage of the
program get all screwed up. I took the figures from a previous
posting:

My guess is that you have 32mb on your videocard? Sun’s Xserver does
the same thing… Might be considered as a bug/feature of ‘ps’ though

Wow, 32MB of video memory. :slight_smile:

No, it’s not really allocating that RAM, just memory mapping it from your
video card. If the number had been 4MB or 8MB, I would have suggested that
immediately. :slight_smile:

-Sam Lantinga				(slouken at devolution.com)

Lead Programmer, Loki Entertainment Software> On Sun, 08 Aug 1999, you wrote:

My guess is that the XF86DGAGetVideo() call does some kind of memory
mapping of the viedomemory ( don’t know that much about DGA/X but
that’s how it works in DOS, hehe ), and hence the memory usage of the
program get all screwed up. I took the figures from a previous
posting:

My guess is that you have 32mb on your videocard? Sun’s Xserver does
the same thing… Might be considered as a bug/feature of ‘ps’ though

heh yep, I just bought my Xentor 32 the other day. Its a 2D/3D combo card so
you can use all 32 megs of memory in regular 2D mode. So its not really
allocating 32 megs of system memory?


“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec

step
step
step
step
step
step
uh, oh anways, after stepping through many lines of code… I found the line
thats alocating the ~32 megs of memory.

XF86DGAGetVideo(SDL_Display, SDL_Screen,
&unused_ptr, &unused_int, &unused_int, &total_mem);
which is in line 157 of src/linux/x11/SDL_sysvideo.c

I don’t know much about the DGA or xlib functions and what they’re doing so
theres not much else I can say.

-Garrett, WPI student majoring in Computer Science.

“He who joyfully marches in rank and file has already earned
my contempt. He has been given a large brain by mistake, since
for him the spinal cord would suffice.” -Albert Einstein

Read this:

http://glide.xxedgexx.com/3DfxRPMS_vb_glibc.html

(the answer might be in the small FAQ section)

Tomas AndrleOn Fri, 6 Aug 1999, Garrett wrote:

My Voodoo 3 X server do the same thing .

226 root 0 0 64604 60M 1572 S 0 1.7 77.8 1:13 XF86_SVGA

But the Server homepage say it’s cause of the Video Memory mapping …

By the way, anyone know a good STL heap tutorial ? cause my book talk about
heap_sort but not in deep detail so I’m confuse :frowning:

JeremieOn Sun, 08 Aug 1999, you wrote:

On Sun, 08 Aug 1999, you wrote:

My guess is that the XF86DGAGetVideo() call does some kind of memory
mapping of the viedomemory ( don’t know that much about DGA/X but
that’s how it works in DOS, hehe ), and hence the memory usage of the
program get all screwed up. I took the figures from a previous
posting:

My guess is that you have 32mb on your videocard? Sun’s Xserver does
the same thing… Might be considered as a bug/feature of ‘ps’ though

heh yep, I just bought my Xentor 32 the other day. Its a 2D/3D combo card so
you can use all 32 megs of memory in regular 2D mode. So its not really
allocating 32 megs of system memory?

Wow, 32MB of video memory. :slight_smile:

No, it’s not really allocating that RAM, just memory mapping it from your
video card. If the number had been 4MB or 8MB, I would have suggested that
immediately. :slight_smile:

-Sam Lantinga (slouken at devolution.com)

step
step
step
step
step
step
uh, oh anways, after stepping through many lines of code… I found the line
thats alocating the ~32 megs of memory.

XF86DGAGetVideo(SDL_Display, SDL_Screen,
&unused_ptr, &unused_int, &unused_int, &total_mem);
which is in line 157 of src/linux/x11/SDL_sysvideo.c

I don’t know much about the DGA or xlib functions and what they’re doing so
theres not much else I can say.

My guess is that the XF86DGAGetVideo() call does some kind of memory
mapping of the viedomemory ( don’t know that much about DGA/X but
that’s how it works in DOS, hehe ), and hence the memory usage of the
program get all screwed up. I took the figures from a previous
posting:----

PID TTY MAJFLT MINFLT TRS DRS SIZE SWAP RSS SHRD LIB DT
COMMAND
1448 p0 554 633 32 3284 3316 0 3316 1904 0
653 ProjectX

PID TTY MAJFLT MINFLT TRS DRS SIZE SWAP RSS SHRD LIB DT
COMMAND
1453 p0 582 641 32 36056 36088 0 36088 2016 0 658
./ProjectX


(36088 - 3316) / 1024 == 32

My guess is that you have 32mb on your videocard? Sun’s Xserver does
the same thing… Might be considered as a bug/feature of ‘ps’ though
:slight_smile:

//Jim

Jim Tilander
System Administrator at Chalmers University of Technology,
Engineering Physics
phone: +46 31 772 3390 fax: +46 31 772 3204