Setting Stack Sizes for User-Defined Routines When you specify a stack size for a user-defined routine, the server allocates the specified amount of memory for every execution iteration of the routine. If a routine does not need a stack larger than 32 kilobytes, do not specify a stack size. Virtual-Memory Cache for Routines Universal Server caches the following items in the virtual portion of the database server shared memory: