I found and fixed a memory leak in Poker Copilot's HUD this afternoon. That's the satisfying way I like Fridays to end.
A small component of Poker Copilot is written in Objective-C and Cocoa, the standard tools for Mac OS X programs. (The rest of Poker Copilot is written in Java). In Java, all the memory is cleaned up automatically using Java's absolutely amazing and astounding garbage collector. For the first few years of Java, its garbage collector was primitive and caused long-running Java programs to freeze for some seconds from time to time. These days, however, the Java garbage collector is a programming work of art, working seamlessly, efficiently, and - most important of all - invisibly.
I've got used to that world. So moving into Objective-C, where I have to manually make sure memory is released seems like a jump back a decade or two in time. There is a garbage collector in Objective-C, but it produces code for Mac OS X 10.5+. When I tried to move Poker Copilot away from OS X 10.4 (Tiger) I had the virtual equivalent of an angry mob outside the front door, demanding justice for all. Well, for all the members of the angry mob!
And so, the Poker Copilot HUD had a memory leak. With the help of Xcode, Instruments, and this excellent blog post, I was able to find the leak and banish it forever. And hold of the angry mob.
Now back to the nice world of Java.
The Poker Copilot Blog
Tracking the development of Poker Copilot, Mac OS X software for poker analysis and statistics.
Friday, 19 June 2009
Finding Memory Leaks in Cocoa + Objective-C
Subscribe to:
Post Comments (Atom)
Poker Copilot Translation Project
Want to use Poker Copilot in your language? Then help with the Poker Copilot Translation Project.
Blog Archive
-
▼
2009
(337)
-
▼
June
(29)
- Poker Copilot: One Year Old
- Poker Copilot 2 Early Access Program Update
- Poker Copilot 1.76 Released
- A Lousy Poker Copilot Week - And a New Feature
- Stuff from Aidan + Posterous = Instant New Blog
- Food, Inc
- Poker Copilot HUD always on?
- Sub-Millisecond Query Optimisation
- Poker Copilot 2 Early Access Program Update
- Multi-table HUD demo
- What's Poker Copilot Missing that Hold'em Manager ...
- Finding Memory Leaks in Cocoa + Objective-C
- FastSpring and Credit Card Fraud
- Does Poker Copilot have Ongame Network Support?
- Poker Copilot 2 Early Access Program Update
- Poker Copilot Tutorial in French
- Mac-ify your Full Tilt Poker
- Why does Poker Copilot talk to the Internet?
- Poker Copilot's Crash Reporter
- Sentence of the Day
- What I've Been Reading
- Obscure Sentence of the Day
- Cha-ching!
- Statistic of the Day
- Hero Stats for Current Table Only
- Poker Copilot 1.74 Released
- C is to Java as Java is to what?
- Competitors for Google?
- Poker Copilot goes Cyrillic?
-
▼
June
(29)


4 comments:
You will be able to use all the new developer feature from snow L for PC V.3
By the time PC V.3 is ready all the PowerPC macs will be very long in the tooth and most people will have to upgrade and you can be done with it.
Did you go to the developer show btw? or watch the keynote anyway?
Was this a problem for version 1 or 2 or both?
@Anonymous:
Poker Copilot 3? Wow! That's getting ahead of things. :-)
@KeithX:
I found the problem in PCP 2, but it is almost certainly present in version 1, as well.
@Anonymous:
Poker Copilot 3? Wow! That's getting ahead of things. :-)
Well, thats what im saying. By the time your ready to release that, PowerPc macs will be old enough to where 90% of copilot users will be running on an intel mac.
Post a Comment