GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Description: Phusion Passenger (mod_rails)
Homepage: http://www.modrails.com/
Clone URL: git://github.com/FooBarWidget/passenger.git
Click here to lend your support to: passenger and make a donation at www.pledgie.com !
Lower StandardApplicationPool's cleaner thread's stack size to 128 KB. 
This decreases VM size dramatically.
Hongli Lai (Phusion) (author)
Thu Apr 24 05:36:06 -0700 2008
commit  c2512e8542966228f86e1e89726e4b765a14d2fa
tree    99b90ac6da2564fc7b51bd95281de57a6848a2db
parent  5f061cbeb83d27d101528f8de7bb0d020d82a5af
...
110
111
112
 
 
113
114
115
...
283
284
285
286
 
 
 
 
287
288
289
...
110
111
112
113
114
115
116
117
...
285
286
287
 
288
289
290
291
292
293
294
0
@@ -110,6 +110,8 @@ public:
0
  */
0
 class Client {
0
 private:
0
+ static const int CLIENT_THREAD_STACK_SIZE = 1024 * 128;
0
+
0
   /** The Server that this Client object belongs to. */
0
   Server &server;
0
   
0
@@ -283,7 +285,10 @@ public:
0
    * connection.
0
    */
0
   void start(const weak_ptr<Client> self) {
0
- thr = new thread(bind(&Client::threadMain, this, self), 1024 * 128);
0
+ thr = new thread(
0
+ bind(&Client::threadMain, this, self),
0
+ CLIENT_THREAD_STACK_SIZE
0
+ );
0
   }
0
   
0
   ~Client() {
...
88
89
90
 
91
92
93
...
422
423
424
425
 
 
 
 
426
427
428
...
88
89
90
91
92
93
94
...
423
424
425
 
426
427
428
429
430
431
432
0
@@ -88,6 +88,7 @@ class StandardApplicationPool: public ApplicationPool {
0
 private:
0
   static const int DEFAULT_MAX_IDLE_TIME = 120;
0
   static const int DEFAULT_MAX_POOL_SIZE = 20;
0
+ static const int CLEANER_THREAD_STACK_SIZE = 1024 * 128;
0
 
0
   friend class ApplicationPoolServer;
0
   struct AppContainer;
0
@@ -422,7 +423,10 @@ public:
0
     count = 0;
0
     active = 0;
0
     maxIdleTime = DEFAULT_MAX_IDLE_TIME;
0
- cleanerThread = new thread(bind(&StandardApplicationPool::cleanerThreadMainLoop, this));
0
+ cleanerThread = new thread(
0
+ bind(&StandardApplicationPool::cleanerThreadMainLoop, this),
0
+ CLEANER_THREAD_STACK_SIZE
0
+ );
0
   }
0
   
0
   virtual ~StandardApplicationPool() {

Comments

    No one has commented yet.