Cherry-pick aix memory fixes

This commit is a cherry-pick of commits merged onto master that are strictly bugfix. They fix broken facts on aix.