Computers, Software, Programming, anything Electronic
Computers, Software, Programming, anything Electronic
If you have noticed CrashPlan is using too much memory on your 64 bit Mac, one solution might be to run its server process in 32 bit mode. I’ve tried this, and so far it hasn’t caused any problems, and definitely seems to keep memory usage lower.
This requires a bit of hacking, but its not too terrible.
Start by opening your ‘Terminal’ program. You can find it in /Applications/Utilities/Terminal
At the command prompt, type this (all on one line):
sudo nano /Library/LaunchDaemons/com.crashplan.engine.plist
Find these two lines:
<string>-Dapp=CrashPlanService</string>
<string>-Xmn10m</string>
And insert a line so that it now looks like this:
<string>-Dapp=CrashPlanService</string>
<string>-d32</string>
<string>-Xmn10m</string>
Optional: A little further down the file, you will see this line:
<string>-Xmx512m</string>
You can change that line to be:
<string>-Xmx150m</string>
This will restrict CrashPlan to AT MOST 150 mb of ram. According to CrashPlan tech support this is perfectly safe (and you could go even lower if aren’t backing up 120gb like I am), but you might need to monitor CrashPlan for out-of-memory errors and such. If you see errors, just change that 150 back to a 512, and everything should be fine.
Now save the file and exit by pressing “Control-O”, Enter, then “Control-X”.
You are almost done.
The last step is to reload and relaunch CrashPlan with these commands:
sudo launchctl unload /Library/LaunchDaemons/com.crashplan.engine.plist
sudo launchctl load /Library/LaunchDaemons/com.crashplan.engine.plist
Now CrashPlan should be using much less memory.
Update: I neglected to point out HOW to check how much memory Crashplan is using. You can use Activity Monitor to do this, you can find it at /Applications/Utilities/Activity Monitor. Look for a process called ‘java’, started by ‘root’. There might be more than one ‘java’, so you might have to do some digging to figure out which one is Crashplan. I can’t find a specific way in Activity Monitor to check this, but one hint is to close any applications you have running and see if other ‘java’ instances go away. In my case, I normally just have the ‘Crashplan’ java running.
Today, I decided to flush out and clean up my A* implementation in Clojure. I cleaned up the namespaces, removed some cruft, got the Java integration working (which required by-passing RT.loadResourceScript() since it seems to be broken), and moving my graph structure definition out of code and into a separate XML file (which is read and parsed directly in Clojure).
I’m still not sold on functional programming, these minor changes took me more hours than I care to admit and gave me a crazy headache, but that could just be because I’m unfamiliar with the language.
I also uploaded the code to GitHub, because I figured where’s the fun in learning a new algorithm in a new language without tossing in the risk of losing all your code to an silly mistake with an unfamiliar version control system?
Luckily no data was lost, and if you have any interest in Clojure, Clojure-Java integration, or A-Star search, check it out here:
http://github.com/jbcpollak/AStar-Clojure
My next steps are going to be more rigorous unit testing and perhaps some benchmarking. I’d like to see how this implementation does against a large graph.
The Problem
Frequently, say, one out of 10 times, when I try and log back into my Mac from the screensaver, or when I wake it from sleeping, I will get a spinning beachball and be unable to type my password. Other times I will be able to log in, but I am prompted to enter my password multiple times for various applications, and invariably one of them (usually gconsync) will get stuck after I enter my password with a spinning beach ball. I can still use most applications, but application that needs keychain authorization locks up.
I happen to be using a very handy tool called SSHKeychain, which turned out to be the culprit.
If you are using SSHKeychain, this post will walk you through fixing the unstable-wake-from-screensaver, and also solves the problem of having to type your keychain password 3-5 times when I returned to my computer.
read this entry »If you are having trouble compiling Android on Snow Leopard, first make sure you’ve installed the Leopard 10.5 Java 1.5 SDK, according to these instructions.
Second, make sure you have the latest XCode installed, and make sure you have installed the optional 10.4 SDK. In my case, it appeared that the 10.4 sdk was installed, but it was either corrupt or out of date, resulting in many strange errors like the following:
(out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/javalib.jar) Docs droiddoc: out/target/common/docs/framework Could not load 'clearsilver-jni' java.library.path = out/host/darwin-x86/lib make: *** [out/target/common/docs/framework-timestamp] Error 45
host C: emulator <= external/qemu/distrib/zlib-1.2.3/adler32.c host C: emulator <= external/qemu/distrib/zlib-1.2.3/compress.c host C: emulator <= external/qemu/distrib/zlib-1.2.3/crc32.c host C: emulator <= external/qemu/distrib/zlib-1.2.3/deflate.c host C: emulator <= external/qemu/distrib/zlib-1.2.3/gzio.c In file included from external/qemu/distrib/zlib-1.2.3/gzio.c:601: /Developer/SDKs/MacOSX10.4u.sdk/usr/include/stdarg.h:4:25: error: stdarg.h: No such file or directory external/qemu/distrib/zlib-1.2.3/gzio.c: In function ‘gzprintf’: external/qemu/distrib/zlib-1.2.3/gzio.c:610: warning: implicit declaration of function ‘va_start’ external/qemu/distrib/zlib-1.2.3/gzio.c:628: warning: implicit declaration of function ‘va_end’
make clean && make
Unfortunately, I’m still stuck with this build error I haven’t gotten past yet:
host Prebuilt: libSDL (out/host/darwin-x86/obj/STATIC_LIBRARIES/libSDL_intermediates/libSDL.a)
ranlib: file: out/host/darwin-x86/obj/STATIC_LIBRARIES/libSDL_intermediates/libSDL.a(SDL_getenv.o) has no symbols
ranlib: file: out/host/darwin-x86/obj/STATIC_LIBRARIES/libSDL_intermediates/libSDL.a(SDL_malloc.o) has no symbols
ranlib: file: out/host/darwin-x86/obj/STATIC_LIBRARIES/libSDL_intermediates/libSDL.a(SDL_qsort.o) has no symbols
ranlib: file: out/host/darwin-x86/obj/STATIC_LIBRARIES/libSDL_intermediates/libSDL.a(SDL_stdlib.o) has no symbols
ranlib: file: out/host/darwin-x86/obj/STATIC_LIBRARIES/libSDL_intermediates/libSDL.a(SDL_audiodev.o) has no symbols
ranlib: file: out/host/darwin-x86/obj/STATIC_LIBRARIES/libSDL_intermediates/libSDL.a(SDL_mixer_MMX.o) has no symbols
ranlib: file: out/host/darwin-x86/obj/STATIC_LIBRARIES/libSDL_intermediates/libSDL.a(SDL_yuv_mmx.o) has no symbols
ranlib: file: out/host/darwin-x86/obj/STATIC_LIBRARIES/libSDL_intermediates/libSDL.a(SDL_nullmouse.o) has no symbols
host Prebuilt: libSDLmain (out/host/darwin-x86/obj/STATIC_LIBRARIES/libSDLmain_intermediates/libSDLmain.a)
host Executable: emulator (out/host/darwin-x86/obj/EXECUTABLES/emulator_intermediates/emulator)
Undefined symbols:
"_xml_builtin", referenced from:
_xml_builtin$non_lazy_ptr in gdbstub.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [out/host/darwin-x86/obj/EXECUTABLES/emulator_intermediates/emulator] Error 1
So if anyone has any tips on that, I’d appreciate it!
I wanted to refresh my knowledge of functional programming, A-Star search, and I figured learning Clojure at the same time couldn’t hurt. I figured I’d do all three at once, and throw in a health dose of Maven and Java at the same time.
This project was intended to:
Once downloaded, unzip the zip file and open a terminal.
You now have three options:
Review the Source Code
The meat of the code is all in Clojure, here:
src/main/resources/com/example/clap/astar.clj
There is a bit of boot-strap Java code in the following file, but I can’t say its all that interesting:
src/main/java/com/example/clap/App.java
Running from Source
If you are on a Mac, or you already have Maven and Java installed, just run the following:
cd astar && mvn test
Maven will download all the needed packages and then compiled and execute the demo.
Running from Binary
If you are on Linux, or have cygwin installed on Windows, you can run the following:
cd astar/bin/ && ./run-astar
If you are finding mail sometimes not appearing in your Mail inbox after upgrading to Snow Leopard, but then it appears again once you restart Mail, try shutting off the ‘Use IDLE command’ option in account settings. (Its at the bottom of the advanced tab).
After upgrading to Snow Leopard on my Mac, I noticed this was happening with email in my Dreamhost IMAP account.
I’ve been running with the ‘IDLE’ option turned off for a day, and it seems to be working correctly again.