Wednesday, September 24, 2008

Back from Temporary Insanity

(Note to people who don't know me, or potential future employers that probably search names before hiring people: I didn't actually go insane, nor do I have any mental health conditions. Also: What are your retirement benefits?)

So I spent the last couple of months not programming Entrippy or Platzad. I was looking into creating a filesystem optimized for multi-user multi-system backup and synchronization for home networks. Why? Because I needed one. I also had what I thought were useful and intriguing features unique to it as well. As I was coming up with my features list, I continued reading about other filesystems, and then I found out what I was contemplating was implemented in various filesystems and software revision control systems in one way or another. In the end, not one thing was truly unique to my FS, save that all those things together were not found in any one system I looked at. Besides, rdiff-backup will work for now, once I care enough to try it out.

In the end, I came to this thought:

Man, I need to get back into some C++ development! Forget me writing the next great shared filesystem, I needs to get back to my one true love: games.

So there. Platzad here I come.

Friday, September 19, 2008

Memory Allocation

If you read you tech news a lot you might of hear how firefox 3 uses its own memory allocator that they took from FreeBSD called jemalloc. Now when I first read this I did not total understand what that means. I later found out.

So every time memory is allocated on the heap in C/C++ the allocator is called. In C malloc is a function that the allocator provides. In C++ new uses malloc unless you use a placement new (more on that later). This allocator has to get memory from the OS and in Linux it uses mmap or sbrk. The allocator normally wants to get more memory then is being asked so it can create a pool of memory and not have to ask for more all the time because that is slow. This also means the allocator can get memory fragmentation. Jemalloc is suspose the be very good at keeping fragmentation down and that is why firefox uses it. The other thing about memory allocator because they like a pool that don't let go of memory. the free fuction or delete just puts the memory back in the pool.

Jemalloc does a much better job of giving back memory to the OS then the standard allocator in glibc. So if you have an app that uses a lot of memory and then frees it all and you want to get the memory back try jemalloc. I hack the code out of firefox and it work great. Just two file there somewhere and you have to compile with some macros defined. Or you could just get it from the guy who made it. When I did it he had yet to release that. Once you install that all you have to do is link you execuable to it when you compile. Because glibc uses weak symbols for the alloctor funcation the malloc and free and other from the jemalloc implentation will over ride the built in. This is cool I think.

There are lots of other alloctors out there you google and find a lot them google itself made one. Some have a lot of stuff built in to track memory usage like the google one. It also never returns memory unless you call some nonstanderd function in a new version of the library. I forget the name of it I found it some comment I wish I had the link to. Just look at a .h file.

Anyway if the glibc malloc every lets you down it is easy to change and lots of chooses based one what you need. Give it a spin.

Saturday, September 6, 2008

Java 6 u10 RC

Look at the new features of Java6u10. Then look at the date the article was published. This baby should've been out by now, I think. In any case, it looks like Sun is doing a little bit more to make Java look a little bit easier to the consumer.

Thursday, September 4, 2008

VirtualBox 2.0.0 (released 2008-09-04)

Check here for what is new.