You can also optimize memory and cpu management through linux control groups. Oracle published a pretty good description (see: example 1: NUMA Pinning) of how to assign dedicated cpus and memory to a process or group of processes [1], but you can also read about the supporting cpuset & memory cgroups subsystems too [2, 3].
p.s. I can recently created a screencast about control groups (cgroups) for anyone interested @ http://sysadmincasts.com/episodes/14-introduction-to-linux-c...
[1] http://www.oracle.com/technetwork/articles/servers-storage-a...
[2] https://www.kernel.org/doc/Documentation/cgroups/memory.txt
[3] https://www.kernel.org/doc/Documentation/cgroups/cpusets.txt