summaryrefslogtreecommitdiff
path: root/innobase/srv/srv0start.c
diff options
context:
space:
mode:
authorunknown <heikki@hundin.mysql.fi>2003-10-17 23:44:34 +0300
committerunknown <heikki@hundin.mysql.fi>2003-10-17 23:44:34 +0300
commit77f45ffe7799848d27a10887ccdfcb2ba509bb59 (patch)
tree27c4cf6a0ebf62c4a01fd1fe3028b1d331e84e4a /innobase/srv/srv0start.c
parent7a7cbc7db557cc8263622453fc8a52cd9f386647 (diff)
downloadmariadb-git-77f45ffe7799848d27a10887ccdfcb2ba509bb59.tar.gz
thr0loc.c, srv0start.c, srv0srv.c, srv0srv.h, os0thread.h, ha_innodb.cc:
Backport from 4.1: reduce InnoDB memory consumption if buf pool < 8 MB sql/ha_innodb.cc: Backport from 4.1: reduce InnoDB memory consumption if buf pool < 8 MB innobase/include/os0thread.h: Backport from 4.1: reduce InnoDB memory consumption if buf pool < 8 MB innobase/include/srv0srv.h: Backport from 4.1: reduce InnoDB memory consumption if buf pool < 8 MB innobase/srv/srv0srv.c: Backport from 4.1: reduce InnoDB memory consumption if buf pool < 8 MB innobase/srv/srv0start.c: Backport from 4.1: reduce InnoDB memory consumption if buf pool < 8 MB innobase/thr/thr0loc.c: Backport from 4.1: reduce InnoDB memory consumption if buf pool < 8 MB
Diffstat (limited to 'innobase/srv/srv0start.c')
-rw-r--r--innobase/srv/srv0start.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/innobase/srv/srv0start.c b/innobase/srv/srv0start.c
index a85c3615c1b..af4ca71d443 100644
--- a/innobase/srv/srv0start.c
+++ b/innobase/srv/srv0start.c
@@ -1087,6 +1087,28 @@ innobase_start_or_create_for_mysql(void)
return(DB_ERROR);
}
+ /* Set the maximum number of threads which can wait for a semaphore
+ inside InnoDB */
+#if defined(__WIN__) || defined(__NETWARE__)
+
+/* Create less event semaphores because Win 98/ME had difficulty creating
+40000 event semaphores.
+Comment from Novell, Inc.: also, these just take a lot of memory on
+NetWare. */
+ srv_max_n_threads = 1000;
+#else
+ if (srv_pool_size >= 8 * 1024 * 1024) {
+ /* Here we still have srv_pool_size counted
+ in bytes, srv_boot converts the value to
+ pages; if buffer pool is less than 8 MB,
+ assume fewer threads. */
+ srv_max_n_threads = 10000;
+ } else {
+ srv_max_n_threads = 1000; /* saves several MB of memory,
+ especially in 64-bit
+ computers */
+ }
+#endif
err = srv_boot();
if (err != DB_SUCCESS) {