WSPR will run on Mac Os X 10.6.8 with very limited memory leakage

14 posts / 0 new
Last post
N6SKM
Offline
Last seen: 1 year 4 months ago
Joined: 2012/04/21 - 03:31
WSPR will run on Mac Os X 10.6.8 with very limited memory leakage
AttachmentSize
Plain text icon wspr.py_.txt64.79 KB
Image icon wsprnewmac4.jpg169.04 KB

WSPR runs beautifully on Windows and Linux, but all the commentary I'd seen for the Mac indicated that it was hard to port and the ports that had been made had fatal flaws, either crashing or leaking memory. Being a veteran programmer, this was a challenge I couldn't resist. I found several sites that had build instructions and downloaded all the necessary libraries. After getting WSPR built, I discovered that it ran nicely but leaked memory at 100KB/second. Even with an 8GB Mac I couldn't live with that. Worse, the load on the cpu was substantial, including heavy load on the kernel process.

On another site I found a modified version of WSPR that ran without a GUI. It had MUCH lower use of the cpu and no memory leaks, so I knew that the leak was in the wspr.py file, which was readily editable. After a lot of probing I discovered that the tK toolkit seems to have a major leak. Since WSPR has a 0.2 second internal loop through an enormous number of screen object updates, these leaks mounted up quickly. I shielded all the object updates so that they are only updated if the current state has changed. The memory leakage is now about 100KB every 2 minutes, or more than 100 times less. Even this slight amount could be reduced by a few more artifices, but it seems sufficiently usable now. I'd run out of memory after about 1000 hours of continuous operation. I suspect that I'll be bouncing either the system or this app more often than that, and the op system would probably page out the leaked memory anyway.

So, right now I'm looking at a display of 9 different spots with a stable MacOsX version, running on a MacMini. I've attached a sample screen shot. All that is required for anyone who has already installed WSPR on their Mac is to replace wspr.py with my slightly altered version of wspr.py. I'll attempt to attach a copy to this topic. I've added the suffix .txt so it will upload. Remove that suffix and save the file into your build area as wspr.py.

I'd love to package this into a distribution but that isn't a skill that I have. If someone else does, we could finally have a distribution for the Mac that is plug and play.