I assume you're working in Java since you tagged the question with "Android".
If you're really afraid that your memory might be snooped, you're pretty much dead in the water if you're going up against someone with a decent level of sophistication. But there are a few "security through obscurity" techniques that might protect you against a casual snoop.
To start with, sensitive data should be stored in Character[] array and not in String. Once you've used it, you "burn" it by overwriting with zeros and then freeing. This is standard best practices and you should always do this.
You could try "encrypting" the data while it's stored in memory. The simplest way is to XOR it with a long pseudo-random string of bytes. This will make it unintelligible to someone casually scanning through a memory dump, but once they de-compile your app, they'll likely find out what your obfuscation algorithm was and also figure out what piece of memory you used to store the sensitive data.
As another poster mentioned, you should take the trouble to make sure your memory is never swapped to long-term storage. There are system calls you can make in Linux to prevent swapping, but I think their use in Java would be ill-advised. The good news is, I don't think Android uses swap, so this won't be an issue for you.