I'm running LOVE on Fedora 13 and I'm experiencing a quite peculiar behaviour - massive usage of disk cache. Memory consumption of the LOVE process itself is minimal, but the amount of disk space mapped to the process is gigantic. Just check out these few tests I ran. I'm using recent hg source (compiled just a few minutes ago) and I've got a laptop with 1024MB RAM. The code snippets are the _complete_ main.lua files I used, the numbers represent virtual memory (VIRT) measured by htop.
function love.load()
font10 = love.graphics.newFont(10)
font20 = love.graphics.newFont(20)
font30 = love.graphics.newFont(30)
end
966MB
My question is: What's going on in there? What's LOVE peeking all the time? And why would it load anything in the second example? Really, I'd like to know what actions at LOVE's startup could possibly cause this. I'm out of ideas here. Scripts are tiny and fonts don't weight much, either.
Somebody enlight me, pls.
Well, fonts are heavier than you might think, and actually if you do the math you'll see that the (465-202)*3+202 is almost 966. May I ask how you measured this, so I can test this myself?
bartbes wrote:...fonts are heavier than you might think
What do you mean? I checked out the fonts on my system and none had more than 1MB
bartbes wrote:May I ask how you measured this...?
I just ran "love game_dir" on the console and htop on the other. Note that the numbers represent disk cache which gets counted into virtual memory (VIRT collumn). Here are complete data from /proc/[pid]
bartbes wrote:... is this the same with previous versions?
Dunno, I've only used two recent hg sources, the official source tarball didn't compile for me (build script error).
bartbes wrote:About the fonts... they are prerendered
Really?
Why is that so? Is it the performance of rendering itself, or something else? Because I've worked SDL_ttf before (uses FreeType), I rendered with anti-aliasing and alpha and it worked fast enough. So' I don't think pre-rendering is the way to go, at least not if it can't be disabled. IMHO it would be better to let user render texts as images and blit them as so.
Edit: Now that I think of it, pre-rendered fonts aren't the problem unless LOVE swaps them to disk The /proc reports make it clear that actual application data in the RAM are quite small.
Direct question: are you sure there are no files being mistakenly left open at startup?