A Note on Allocating Objects in Multithreaded Applications
Because services created with HydraExpress run in multiple threads, it is recommended that you allocate objects on the heap rather than the stack, a general “best practice” for multithreaded applications. This prevents problems with thread stack size.