Today I was looking over the patches I have submitted so far and found that I broke the number 20 today, so I guess it's a good opportunity for a roundup and for putting things into perspective.
Most of the patches had to do with memory leaks and when it comes to coding a memory leak is a pretty bad word, especially in conjunction with the Second Life browser, because the program (or more precisely it's users) seem to have suffered quite badly from the program eating more and more memory with every hour.
I just did a count. 15 of my patches were memory related in one way or another. I did not count exactly, but my guess is that 10 of them were not leaks in the sense that they did not make the program grow over time. They were just sloppy cleanup of one time objects, meaning they did not give up their memory at the end of the program, which is no big issue from a user's perspective, because the memory was required during the runtime of the program and because the operating system will claim the memory a millisecond after the point when a proper cleanup would have given it up. This stuff happens with most programs and those bugs are more leftovers than leaks in that they do not make the memory footprint of the program grow over time.
Then there were a handful of leaks which were neglectible because they just lost a few kilobytes every time you opened or closed a dialog. For example this was the case with the groups dialog, opening that a hundred times would have lost about half a megabyte. Technically this is a real leak ... it does make the program grow every time you do that, but from a user's practical standpoint these minor leaks are irrelevant as well, meaning nobody will be forced to buy more memory for their computers just for being able running the application longer than an hour or two (unless you are opening and closing that dialog every ten seconds).
Which brings me to THE LEAK. The growth of memory over time had a single prime source, which was a leak in a 3rd party library (an open source project called libcurl) which the Lindens were using to fetch data from their servers. As far as I can tell, they were (and are) using the library version from December 2006 and the libcurl folks found and fixed their leak in mid March.
Interestingly the big leak was the hardest to find. It was the second bug I was looking for when I started with the browser source (the first one was the AFK bug) and it took me three full days to nail it.
The reason was partly that it was clouded by leftovers, mini leaks and normal growth of the memory footprint. I first tried to reproduce it more consistently which failed because the program grows to a certain extent over the first half hour as part of the regular design (the memory cache for textures filling up). Took me a day or so to figure it out and eventually resulted in filing an issue to fix regular memory consumption (VWR-733).
Then, when I eventually understood what part of the footprint was "normal" (by design), I still did not know if the stuff I was looking at the leaks log was mainly due to the fact that the program left over parts of it's normal memory consumption or if it was genuinely leaky stuff.
I know now, that most of that stuff in the log *was* actually leaky. The leaks and leftovers I'm finding today are increasingly easy to locate because there is less and less left in the leaks log. It just sticks out. But back then, what I was looking at were logs the size of 50-100MB with nothing but dumped memory blocks.
The reason why I'm writing this is to put things a bit into perspective. It's not that the SL browser is leaking all over. In fact the other real leaks were really neglictible, what made things hard were the leftovers because they cluttered the logs and those logs don't tell which is a leftover and what is a leak.
Which is, why I am currently so religious about fixing all that seemingly irrelevant stuff. Those mini leaks and leftovers may be irrelevant to the end user and with all those shiny new features in the pipeline it's easy to write them off as a secondary or unimportant, and quite frankly, it takes a bit of a deviant coder personality to find pleasure in tracking that kind of stuff down. But sooner or later they are going to come back and bite you int the butt. And interstingly enough, end users seem to have an acute sense about stuff like that, even without knowing exactly why ... just remember the Open Letter project a month ago.
I've been asked a couple of times why I'm investing the efforts here, and quite honestly I'm not entirely sure what's driving me.
Maybe it's because I' thrilled by this project (Second Life), maybe because I love the intellectual challenge. But I guess a big part of it is that I've talked to one person too many who told me they kept crashing every two hours right in the middle of something and that they didn't have or did not want to spend the money for more memory or a faster computer.
I've been following the forum a bit over the last week, and when it came to memory the standard answer was, that you'll need at least 1.5GB or better 2GB on the machine to run SL decently. Most people I know and used to hang out with on the grid however just have 512MB and only a few upgraded to 1GB for the program. I myself bought a new computer because the damn thing did almost swap the hard disk to death on my 512MB laptop and because I thought the low FPS rates were due to the video board.
Go figure ...
Wednesday, May 30, 2007
Subscribe to:
Post Comments (Atom)
20 comments:
Memory is what memory does. - Forrest Gump's Mom.
Thanks for this Nick!
Thank you so much for tracking down these leaks. In my experience all the trivial leaks really cloud the picture when an application shuts down. This cleanup work is very important. Keep up the good work!
This is great work. Thanks!
Thanks everybody, the heads up is really appreciated!
I just saw you referred to as the Mad Patcher
LOL
keep up the great work!
LOL, I like that (Mad Patcher) will use it as my in-world group title (that's currently "Clueless Hacker" :-)
just wanted to let you know I've tested your latest version ofthe patched client today-no crashes, runs smoothly. Thanks for the hard work! Dankeschön!
Just wanted to say great job. It's nice to know people are out there picking up those important little pieces that often get left behind :)
it's a real pleasure to know that you are actively putting the bugs to rest nicholaz. reading about your endeavours inside the code is sweet music. your dedication will not go unrewarded. job well done.
Hello Sir.
I want to know if all theses fixes and major issues fixes will be in second life 1.7. Why don't you work for second life??? It seems like u care more than them.
Absolutely can't thank you enough for staying on top of these. :)
So happy you are here to help
It's people like you Nick, that can bring this game / world into the future... as i'm sure all can see, we are at the turning point of a new revolutionary way of living. Something people will look back on and see where it all began, where the turning point was. Without Mad Patchers like Nick, this game / world could easily break down through frustrations... and maybe take a back burner for far too many years to wait for a return. WE NEED MORE MAD PATCHERS LIKE NICK ! KEEP UP THE AMAZING WORK ! PLZ :)
I Agree with the above, LONG LIVE "THE MAD PATCHERS" LONG LIVE NICK !
They should make a Statue after Nic,
for all this brilliant hard work !
They should call it simply...
"The Mad Patcher" so all can come
kneel before it lol.
Seriously...
(although statue good idea)
Thank you for all your painful
hard work ! You're a Star !
An SL Statue of "The Mad Patcher"
I love it !
Bravo Nick !
Thank you soo much for careing and taking the time.
Please stay independant. Inside of LL you will be told what area to work on. Outside you can set your own schedule.
..and yes I do know what I am talking about ;)
Besides having my own company and living in Germany, LL is now so big and now doing many things so fundamentally different than how I do them, that I wouldn't consider working there.
And yes, I do value my freedom of choice (more than anything else in fact :-)).
Nick
Hi Nicholaz,
I tried to download nicholaz-17a.zip today a couple of times, but my Winzip complains about some crc-check-failure.
Something wrong with the file, or maybe just me?
Hugs
Ninnie
Post a Comment