What is shrink_slab, and why is it showing up in /var/log/messages?

Your message is generated by the slab allocator, the mechanism used by the Linux kernel to manage the portion of memory it needs for itself (not for user space processes). Originally it was written by Jeff Bonwick for Solaris, and it's probably easiest to understand by reading Bonwick(94) (PDF).

If you are wondering about the name, in his blog Bonwick eventually revealed the story behind it.

When you're looking at the Linux specifics, the article Anatomy of the Linux slab allocator (link currently dead, see archive.org for a copy) should cover that. If you want to understand management of user-space memory as well, Mel Gorman, Understanding the Linux Virtual Memory Manager gives even more detail.

For German speaking readers, there's an excellent introduction in the German Wikipedia Article on the slab allocator.

(Links last checked 2021-04-19)