TF2 now requires almost 2.4 GB of RAM, up from 800MB... What?

Vel0city

func_fish
aa
Dec 6, 2014
1,947
1,589
Like. Seriously. In the history of me playing this game (for about 2300 hours) the game never needed more than 800 MB. Now that's tripled, probably since the last update (which also brought back the "can't load lump x, allocation of xxxxxxxx bytes failed!" error which causes the game to crash after every map change).

Something somewhere is leaking memory into the main memory pool, and every time a map loads (which is a single big file) the game doesn't know where to put the map into the memory so it just crashes.

Now before people go "u have toaster rite?": no I don't have a toaster. i7-4870HQ, 16GB of DDR3-1600 RAM, GT750M with 2 GB dedicated GDDR5 RAM, some PCI-e SSD. Only difference is I run OS X 10.10.3. Now this all started occurring after the April 29th update, before that it was fine.

Is there any way to get TF2 back to normal memory usage via console commands/launch options or do I have to wait until Valve decides to fix this? Valve should be aware of this, I've sent them at least 8 or 9 crash reports in the last 2 days. Now we wait.
 

Waffe

L5: Dapper Member
Dec 2, 2012
230
203
It works fine for me, it takes about ~650 M RAM (windows masterrace?)
 

Vel0city

func_fish
aa
Dec 6, 2014
1,947
1,589
Yeah, I get the impression it's an OS X problem. It's not the first time the OS X version gets completely borked.

Ok, I can confirm it's an OS X problem. On my Windows 7 partition it memory usage stays below 850 MB.

Why the OS X version needs 3x that amount still remains a mistery to me.
 
Last edited:

Pocket

Half a Lambert is better than one.
aa
Nov 14, 2009
4,694
2,579
My guess is that some part of the dynamic model loading system has failed, since that's the main thing the game uses to keep memory usage down.

Valve cares about as much about OS X as Activision cares about PC, so it's no big surprise to me that something that important failed without them noticing.
 

Vel0city

func_fish
aa
Dec 6, 2014
1,947
1,589
There may be something true about that. A couple of the crashed threads mentioned something with prop_statics.
 

Kraken

Few more zeros and ones for the site to proccess
Dec 21, 2014
430
121
I have a potato Mac and I don't get this kind of crash. Maybe its something to do with your computer settings?
 

Vel0city

func_fish
aa
Dec 6, 2014
1,947
1,589
This is my autoconfig:

hud_combattext_batching 1
hud_combattext_batching_window 1
viewmodel_fov 70
fov_desired 90
cl_updaterate 66
cl_cmdrate 66
rate 60000
cl_interp_ratio 1
cl_burninggibs 1
snd_mixahead 0.05
cl_interp 0.015
mat_picmip -1
mat_specular 1
r_lod 0
fps_max 61

That's it. All the other settings have been done with the in-game settings menu. Everything's set to max, with the exception of AA which is set to 4x.
 

Vel0city

func_fish
aa
Dec 6, 2014
1,947
1,589
It seems to only affect OS X, and normally memory usage is at around 850 MB, not 2.4 GB. Something is leaking in TF2's code.
 

worMatty

Repacking Evangelist
aa
Jul 22, 2014
1,257
999
I am on a late 2012 iMac. i7 3.4GHz. GTX 680MX with 2GB video RAM. 8GB of RAM. For the first few months TF2 ran fine. But then it began to crash after five minutes or so of gameplay. I went back and forth with Valve support, sending crash logs, over a few weeks. All I got from them after deleting and installing everything from scratch, deleting files, and so on, was that there was a fix in the works.

I kept my eye on updates but never saw anything about a fix for crashes on Macs. These days, I can play TF2 on Mac OS X for a longer period, maybe half an hour to an hour, but it still crashes. What's more, its performance sucks arse now. Framerates seem to be locked to 60fps, but they frequently dip below that.

I stopped playing it for a while and played WoW instead. WoW's Mac client is flawless and its performance is the best. When I want to play TF2 or another Valve game I just boot in to Windows 8 via Bootcamp. But that, coupled with the fact the developer tools work beter in a native install rather than a virtualised one, means I'm kept away from my normal OS X desktop environment for long periods, which is a shame because I prefer it.

So I have come to think that TF2 just sucks on Mac. I've given up.

If you actually do something to fix it I will worship you as an idol.
 

Vel0city

func_fish
aa
Dec 6, 2014
1,947
1,589
I've emailed Eric Smith about this and a couple of other game breakers. I haven't heard of him yet, but I do expect an update at some point.

I too have a Bootcamp partition with W7, but I don't like how TF2 looks on DirectX. There's a big difference between OpenGL rendering and DirectX rendering.
 

Vel0city

func_fish
aa
Dec 6, 2014
1,947
1,589
Ok so a bit of digging around reveals a pretty big memory leak when loading a map, and a bit more digging it has to do with the lightmaps in the bsp lump tree. Lump 8 (the lump that crashes the game when switching maps) stores the lightmap data for the map, and it seems that that's what's causing TF2 to crash when loading a new map. It doesn't get rid of the old lightmap information from the memory pool, and when it tries to add the new info from a new map it simply runs out of memory because of the game's 32-bit nature. Having a 2GB videocard next to it isn't helping much either. After doing some quick calculations with regards to max memory usage (take the max of 4GB, take away 256-512 MB for OS related stuff/talking to Steam and then subtract the VRAM from that) revealed that in my case TF2 can adres about 2.3 GB of system RAM, VRAM excluded (I subtracted 1GB form that instead of 2GB since TF2 never ever uses 2GB of VRAM). And guess what, TF2 crashes at exactly that memory usage level.

Yay, I figured something out. Whoohoo. Now lets hope Valve also figures out how to fix this once and for all.
 

worMatty

Repacking Evangelist
aa
Jul 22, 2014
1,257
999
Yay! Great work. I hope some positive action is taken.

I too prefer the look of TF2 in Mac OS's OpenGL. Text is nicer, and the textures seem to be a bit more vibrant.
 

Pocket

Half a Lambert is better than one.
aa
Nov 14, 2009
4,694
2,579
Valve: Making you do our job for us, and then refusing to even accept your help if we're too embarrassed about the problem.
 

Vel0city

func_fish
aa
Dec 6, 2014
1,947
1,589
Update:

The June 2nd update now broke the game even more, making it crash pretty much 2-3 minutes after loading a map.

Good coding you have there Valve. Great job.
 

Kraken

Few more zeros and ones for the site to proccess
Dec 21, 2014
430
121
Update:

The June 2nd update now broke the game even more, making it crash pretty much 2-3 minutes after loading a map.

Good coding you have there Valve. Great job.

This hasn't happened to me and I play with a Mac.
Maybe it's something to do with some mod you've downloaded?
 

Vel0city

func_fish
aa
Dec 6, 2014
1,947
1,589
This hasn't happened to me and I play with a Mac.
Maybe it's something to do with some mod you've downloaded?

I don't have anything installed other than the game. Useless anyway since Valve servers block custom content.

Now that I think of it though, I've played TF2 today for quite a few times now. Only when the TF2maps.net EU server had Stoneyridge playing did the crashes occur. Strange though. But still. The game still crashes when switching maps. That's bogus.