Author Topic: Thus spoke taylor: "What memory leak?" [build attached]  (Read 8281 times)

0 Members and 1 Guest are viewing this topic.

Offline Flipside

  • əp!sd!l£
  • 212
Thus spoke taylor: "What memory leak?" [build attached]
-spec -glow -pcx32 -jpgtga -d3dmipmap -phreak -ship_choice_3d -targetinfo -nomotiondebris -2d_poof -snd_preload -dnoshowvid -show_mem_usage  -fov 0.39 -mod TwistedInfinities

Still getting jerkiness here with the .vp installed. I don't think I should be, I'm using a XP1700+ with 768Mb of memory, with a GeForce FX5600 with 256Mb of memory.

Something hints that it seems to be problematic when messages are sent, that's why I tried the pre-load sound flag, but it just seemed to make matters worse :(

 

Offline Kazan

  • PCS2 Wizard
  • 212
  • Soul lives in the Mountains
    • http://alliance.sourceforge.net
Thus spoke taylor: "What memory leak?" [build attached]
even without the leak i get like 700MB total usage in WCSaga
PCS2 2.0.3 | POF CS2 wiki page | Important PCS2 Threads | PCS2 Mantis

"The Mountains are calling, and I must go" - John Muir

 

Offline taylor

  • Super SCP/Linux Guru
  • Moderator
  • 212
    • http://www.icculus.org/~taylor
Thus spoke taylor: "What memory leak?" [build attached]
Quote
Originally posted by Kazan
taylor: did the 'known bug' show up recently? it may be my fault (when i added AIM_FLY_TO_SHIP)

It's in Mantis, I think it's been closed twice but people keep reporting it.  It's probably a memory issue but it was first reported (that I know of) in February.

http://mgo.maxgaming.net/mantis/bug_view_page.php?bug_id=0000087

 

Offline Fear

  • 26
Thus spoke taylor: "What memory leak?" [build attached]
hmm that strange only 700? i use 900 in this build.
my fps is gr8 but everyfew seconds i got 1/2sec freeze, or the fps just suck .

cant see why my comp CAN handle it i think
gigabyte sq800
1.6A ghz
512 ddr(dual channel)
r9500pro 128mb.
no o/c.

 

Offline taylor

  • Super SCP/Linux Guru
  • Moderator
  • 212
    • http://www.icculus.org/~taylor
Thus spoke taylor: "What memory leak?" [build attached]
Quote
Originally posted by Flipside
-spec -glow -pcx32 -jpgtga -d3dmipmap -phreak -ship_choice_3d -targetinfo -nomotiondebris -2d_poof -snd_preload -dnoshowvid -show_mem_usage  -fov 0.39 -mod TwistedInfinities

Is is still happening if you don't use -spec, -glow, -pcx32 or -jpgtga?  If you don't use -glow or -spec then it won't load the textures and therefore saves memory.  -pcx32 will double the memory usage of a PCX so if you don't need it don't use it.  Run with -nosound and see if it's any better.

Fear:
If it's using that much memory and you only have 512meg of RAM then it's going to disk for the rest.  That's going to slow it down during disk access which may be the reason for the freeze.  What cmdline options and mods are you using to get a 900meg footprint?

Everyone:
The game loads every single texture that's used in a mission on load.  The more TGA and ANIs that are in there the higher the memory usage is going to be.  One of the explosions for instance can use 5.75meg of memory by itself.  There isn't a whole lot that the coders can do about this but we are trying to make sure that what gets loaded is actually going to be used so there is no waste.  When stuff is paged in during a mission then that's where a freeze or stutter comes from so we are going to get complaints either way.

If you don't have the memory then don't use the hi-memory options.  Stay away from -pcx32 and -jpgtga, use the non-TGA planets, don't use hi-poly ships.  Also don't run anything in the background if you can help it.  If the computer is already using 120megs of RAM before you start the game then things aren't going to work as well as they could.  We can plug every memory leak in the game but the memory usage will still get higher as more options are used.  The artists and mod makers can do as much to keep the memory footprint low as the coders can, if not more.

 

Offline Flipside

  • əp!sd!l£
  • 212
Thus spoke taylor: "What memory leak?" [build attached]
Ok, no change with -nosound, however, removing -pcx32 helped a bit. There was still a little stuttering at Warp-ins, and often when a message was incoming, but as you play the mission, the effects seem to wear off.

I'm going to install the lite .vp and see whether that helps, thanks for the link Svizel :)

 

Offline Black Wolf

  • Twisted Infinities
  • 212
  • Hey! You! Get off-a my cloud!
    • Visit the TI homepage!
Thus spoke taylor: "What memory leak?" [build attached]
Taylor - will using jpeg textures help or hinder memory usage? I'm asuming filesize is directly related to memory use, which could be faulty, I'll admit.
TWISTED INFINITIES · SECTORGAME· FRONTLINES
Rarely Updated P3D.
Burn the heretic who killed F2S! Burn him, burn him!!- GalEmp

 

Offline Flipside

  • əp!sd!l£
  • 212
Thus spoke taylor: "What memory leak?" [build attached]
Jpeg are decompressed before going into memory, they take up the same amount of room as a 32bit pcx to a video card.

DDS is a good format because the tetures are stored compressed, that's why I try to use them where possible. They're not too wonderful for effects, but I may well have a go at creating DDS files of all the ship textures etc :)

 

Offline taylor

  • Super SCP/Linux Guru
  • Moderator
  • 212
    • http://www.icculus.org/~taylor
Thus spoke taylor: "What memory leak?" [build attached]
Quote
Originally posted by Black Wolf
Taylor - will using jpeg textures help or hinder memory usage? I'm asuming filesize is directly related to memory use, which could be faulty, I'll admit.

Long answer but I'm just covering all bases:

Memory usage is calculated like this: (w * h * Bpp * frames)

Width and height should be obvious.  Bpp is bytes-per-pixel so 8-bit is 1, 16-bit is 2, 32-bit is 4.  Frames isn't taken into account unless its an ani but you get the point.  Basically it doesn't matter what format you use (unless it's DDS) since a JPG version of a TGA image is still going to take the same amount of memory.  The only thing it takes less of is disk space.  DDS can be sent to the card still compressed (for those that support it) so it will always take up less memory.  Using smaller images when possible or just less of them makes the difference.  The fewer number of frames in an ANI the less memory it's going to use.  If you load ship with animated textures then it's going to add up.

For mod makers, mission design has a big impact.  Ship/weapon textures are loaded once for each image.  So if you have 10 Ulysses in a mission then it's only going to load one set of textures and use them on all 10.  If you have 10 different types of ships and a bunch of different crusiers and larger ships then the memory usage is going to go through the roof.

 

Offline TopAce

  • Stalwart contributor
  • 212
  • FREDder, FSWiki editor, and tester
Thus spoke taylor: "What memory leak?" [build attached]
Question: If I use 70 nebula/planet backgrounds in a mission, does it slow down a game more if I only used 32 of them, but the 32 are different. The 70 case has for example 20 types of images, most of them are used multiple times.

Question 2: Does scaling affect memory usage/Frame per second?
« Last Edit: July 29, 2004, 12:13:44 pm by 1079 »
My community contributions - Get my campaigns from here.

I already announced my retirement twice, yet here I am. If I bring up that topic again, don't believe a word.

 

Offline jdjtcagle

  • 211
  • Already told you people too much!
Thus spoke taylor: "What memory leak?" [build attached]
YAY!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!11
Does it work?*downloads*
"Brings a tear of nostalgia to my eye" -Flipside
------------------------------------------
I'm an Apostolic Christian (Acts: 2:38)
------------------------------------------
Official Interplay Freespace Stories
Predator
Hammer Of Light - Omen of Darkness
Freefall in Darkness
A Thousand Years

 

Offline Kazan

  • PCS2 Wizard
  • 212
  • Soul lives in the Mountains
    • http://alliance.sourceforge.net
Thus spoke taylor: "What memory leak?" [build attached]
memory usage is based on total _UNIQUE_ images used

so using 20 unique images for a total of 20 times is the same memory usage as 20 unique images for a total of 80 times

ie 14 Hellcat V fighters = 1 * (Hellcat V's textures)
7 Hellcat V fighters and 7 Arror fighters = 1 * (HV's Textures) + 1 * (Arrow Textures)

10 Hecates = 1 * (Hecate Textures)
5 Hecates + 5 Deimos = 1 * (Hecate Textures) + 1 * (Deimos Textures)
PCS2 2.0.3 | POF CS2 wiki page | Important PCS2 Threads | PCS2 Mantis

"The Mountains are calling, and I must go" - John Muir

 

Offline jdjtcagle

  • 211
  • Already told you people too much!
Thus spoke taylor: "What memory leak?" [build attached]
Works great!!! :)
"Brings a tear of nostalgia to my eye" -Flipside
------------------------------------------
I'm an Apostolic Christian (Acts: 2:38)
------------------------------------------
Official Interplay Freespace Stories
Predator
Hammer Of Light - Omen of Darkness
Freefall in Darkness
A Thousand Years

 

Offline taylor

  • Super SCP/Linux Guru
  • Moderator
  • 212
    • http://www.icculus.org/~taylor
Thus spoke taylor: "What memory leak?" [build attached]
Quote
Originally posted by TopAce
Question 2: Does scaling affect memory usage/Frame per second?

Not system RAM but can save on video memory if scaling down.  It still keeps the true image size in memory and just sends the resized image to the video card.  Scale up and it takes more video memory, down takes less but the size of the image loaded in RAM stays the same.

Slightly OT but don't want a new post to say it:
In testing right now is some rather simple code that unloads ship textures when they are no longer used in a mission.  So if you have say a couple of Fenris that die or jump out early in a mission and there aren't any more later on then the memory from those textures is released.  This doesn't help on initial memory usage but can be of some help for mission designers.

For instance, you have an intense battle upon entering a mission and the ships involved were destroyed or departed and aren't used later in the mission.  The memory used from those ships gets freed and you have to more room to play with things like message anims, sounds, etc.  After the battle you could have a period of story/plot work without needing much more, if any, memory than you started with in the first place.

The intent of this code is to expand it to cover more areas and hopefully end up with image/object loading being smarter.  This will eventually give us a slightly quicker load time, less memory at start, and lets go of memory we don't need anymore so we can use it for something else.  All of this isn't going to be working anytime soon and is a long term goal.  The hope though is to give mission designers the freedom to create larger and more complex missions while at the same time having some control, or at least insight, into how the memory footprint is going to behave.

 

Offline Starman01

  • 213
  • Mechwarrior
    • Wing Commander Saga
Thus spoke taylor: "What memory leak?" [build attached]
Quote
Originally posted by Fear
Tested it and the memory leak is even huger. from 650mb ram in use in bobboau build. in this build i get 890mb ram of use.

besides loading is still huge and basiclly its fixed nothing for me only made is worse :( FSO still unplayable


Sorry to say that, but same goes for me. The leak is even bigger and renders the games nearly unplayable. I have to reboot after each mission, and the overall framerate is around 20% less than the orginal 3.6. build

I haven't tried that alternative build yet, will do this tomorrow.
MECHCOMMANDER OMNITECH

9 out of 10 voices in my head always tell me that I'm not insane. The 10th is only humming the melody of TETRIS.

 

Offline Kazan

  • PCS2 Wizard
  • 212
  • Soul lives in the Mountains
    • http://alliance.sourceforge.net
Thus spoke taylor: "What memory leak?" [build attached]
that's really odd.. are you sure you're both using the new build -- it wasn't name fs2_open_r.exe but the [date]_fs2_open_r.exe
PCS2 2.0.3 | POF CS2 wiki page | Important PCS2 Threads | PCS2 Mantis

"The Mountains are calling, and I must go" - John Muir

 

Offline CP5670

  • Dr. Evil
  • Global Moderator
  • 212
Thus spoke taylor: "What memory leak?" [build attached]
I actually ran into the old-style crash with this, where it inexplicably dumps you into windows when certain keys are pressed. This used to happen in several builds around 3.5 but stopped happening at some point. For example, I have one mission where I can get it to crash every time if I enable cheats (www.freespace2.com) and press ~U, but it only happens in that one mission, and it's a simple test mission with almost nothing in it. Does that keystroke even do anything? I only hit it by accident instead of ~I. Other missions have similar issues with other keys, although this is the only 100% reliable mission/key combo I have found.
« Last Edit: July 29, 2004, 05:04:14 pm by 296 »

 

Offline Fear

  • 26
Thus spoke taylor: "What memory leak?" [build attached]
Quote
Originally posted by taylor


Fear:
If it's using that much memory and you only have 512meg of RAM then it's going to disk for the rest.  That's going to slow it down during disk access which may be the reason for the freeze.  What cmdline options and mods are you using to get a 900meg footprint?

 

C:\Games\FreeSpace2\28072004_fs2_open_r.exe -spec -glow -pcx32 -jpgtga -d3dmipmap -phreak -ship_choice_3d -2d_poof -d3d_no_vsync -max_subdivide -env -decals  -mod Port

 

Offline Flipside

  • əp!sd!l£
  • 212
Thus spoke taylor: "What memory leak?" [build attached]
decals and -max_subdivide would be the first two I got rid of ;)

 

Offline CP5670

  • Dr. Evil
  • Global Moderator
  • 212
Thus spoke taylor: "What memory leak?" [build attached]
You can probably also remove pcx32 for that matter, which doesn't really do what the launcher description says.