Make memory consumption stats more precise.
Add support for credentials.