# maximize memory usage for mysql and mysql server has gone away error

**URL:** <https://forums.percona.com/t/maximize-memory-usage-for-mysql-and-mysql-server-has-gone-away-error/593>\
**Category:** Other MySQL® Questions\
**Created:** [January 9, 2008, 5:19pm UTC](https://forums.percona.com/t/maximize-memory-usage-for-mysql-and-mysql-server-has-gone-away-error/593 "2008-01-09T17:19:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![so.nakagawa](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@so.nakagawa](https://forums.percona.com/u/so.nakagawa)\
**Post date:** [January 9, 2008, 5:19pm UTC](https://forums.percona.com/t/maximize-memory-usage-for-mysql-and-mysql-server-has-gone-away-error/593/1 "2008-01-09T17:19:45Z")

</div>

Hi all,

I have a problem with configuring my.ini file. I am trying to assign all the memory available on the machine to mysql. Right now I used MySQL Instant Config Wizard to create ini file which is shown below and the database is Innodb. With this config, MySQL is very stable but it is only using about 1.3GB of memory. Widnows/other process is using 1GB which leaves about 1.7GB is still not used.  
The problem is when I increase innodb\_buffer\_pool\_size, mysql returns following error and halts as soon as I run any query or command.

Error Code : 2006  
MySQL server has gone away

I also increased max\_allowed\_packet because this may cause this error, but didn’t work for me. Dose anyone have ideas how I can increase mysql memory use?

Server OS: windows server 2003 R2 Standard Edition SP2  
RAM: 4.00GB (believe or not this 32bit windows recognizes all 4GB)  
CPU: Intel Xeon E5320  
MySQL: 5.0.45-community-nt

* * *

This is my.ini

[client]

port=3306

[mysql]

default-character-set=utf8

[mysqld]

port=3306

basedir=“C:/Program Files/MySQL/MySQL Server 5.0/”

datadir=“C:/Program Files/MySQL/MySQL Server 5.0/Data/”

default-character-set=utf8

default-storage-engine=INNODB

sql-mode=" STRICT\_TRANS\_TABLES,NO\_AUTO\_CREATE\_USER,NO\_ENGINE\_SUBSTITUTI ON "  
max\_connections=100  
query\_cache\_size=0  
table\_cache=256  
tmp\_table\_size=185M  
thread\_cache\_size=8

key\_buffer\_size=32M  
read\_buffer\_size=64K  
read\_rnd\_buffer\_size=256K  
sort\_buffer\_size=256K

innodb\_data\_home\_dir=“D:/MySQL InnoDB Datafiles/”  
innodb\_additional\_mem\_pool\_size=25M  
innodb\_flush\_log\_at\_trx\_commit=2  
innodb\_log\_buffer\_size=12M  
innodb\_buffer\_pool\_size=1172M  
innodb\_log\_file\_size=586M

* * *

This is MySQL server’s status

Variable\_name Value

* * *

Aborted\_clients 2  
Aborted\_connects 0  
Binlog\_cache\_disk\_use 0  
Binlog\_cache\_use 0  
Bytes\_received 138  
Bytes\_sent 336  
Com\_admin\_commands 0  
Com\_alter\_db 0  
Com\_alter\_table 0  
Com\_analyze 0  
Com\_backup\_table 0  
Com\_begin 0  
Com\_call\_procedure 0  
Com\_change\_db 0  
Com\_change\_master 0  
Com\_check 0  
Com\_checksum 0  
Com\_commit 0  
Com\_create\_db 0  
Com\_create\_function 0  
Com\_create\_index 0  
Com\_create\_table 0  
Com\_create\_user 0  
Com\_dealloc\_sql 0  
Com\_delete 0  
Com\_delete\_multi 0  
Com\_do 0  
Com\_drop\_db 0  
Com\_drop\_function 0  
Com\_drop\_index 0  
Com\_drop\_table 0  
Com\_drop\_user 0  
Com\_execute\_sql 0  
Com\_flush 0  
Com\_grant 0  
Com\_ha\_close 0  
Com\_ha\_open 0  
Com\_ha\_read 0  
Com\_help 0  
Com\_insert 0  
Com\_insert\_select 0  
Com\_kill 0  
Com\_load 0  
Com\_load\_master\_data 0  
Com\_load\_master\_table 0  
Com\_lock\_tables 0  
Com\_optimize 0  
Com\_preload\_keys 0  
Com\_prepare\_sql 0  
Com\_purge 0  
Com\_purge\_before\_date 0  
Com\_rename\_table 0  
Com\_repair 0  
Com\_replace 0  
Com\_replace\_select 0  
Com\_reset 0  
Com\_restore\_table 0  
Com\_revoke 0  
Com\_revoke\_all 0  
Com\_rollback 0  
Com\_savepoint 0  
Com\_select 0  
Com\_set\_option 2  
Com\_show\_binlog\_events 0  
Com\_show\_binlogs 0  
Com\_show\_charsets 0  
Com\_show\_collations 0  
Com\_show\_column\_types 0  
Com\_show\_create\_db 0  
Com\_show\_create\_table 0  
Com\_show\_databases 1  
Com\_show\_errors 0  
Com\_show\_fields 0  
Com\_show\_grants 0  
Com\_show\_innodb\_status 0  
Com\_show\_keys 0  
Com\_show\_logs 0  
Com\_show\_master\_status 0  
Com\_show\_ndb\_status 0  
Com\_show\_new\_master 0  
Com\_show\_open\_tables 0  
Com\_show\_privileges 0  
Com\_show\_processlist 0  
Com\_show\_slave\_hosts 0  
Com\_show\_slave\_status 0  
Com\_show\_status 1  
Com\_show\_storage\_engines 0  
Com\_show\_tables 0  
Com\_show\_triggers 0  
Com\_show\_variables 0  
Com\_show\_warnings 0  
Com\_slave\_start 0  
Com\_slave\_stop 0  
Com\_stmt\_close 0  
Com\_stmt\_execute 0  
Com\_stmt\_fetch 0  
Com\_stmt\_prepare 0  
Com\_stmt\_reset 0  
Com\_stmt\_send\_long\_data 0  
Com\_truncate 0  
Com\_unlock\_tables 0  
Com\_update 0  
Com\_update\_multi 0  
Com\_xa\_commit 0  
Com\_xa\_end 0  
Com\_xa\_prepare 0  
Com\_xa\_recover 0  
Com\_xa\_rollback 0  
Com\_xa\_start 0  
Compression OFF  
Connections 6  
Created\_tmp\_disk\_tables 0  
Created\_tmp\_files 5  
Created\_tmp\_tables 2  
Delayed\_errors 0  
Delayed\_insert\_threads 0  
Delayed\_writes 0  
Flush\_commands 1  
Handler\_commit 0  
Handler\_delete 0  
Handler\_discover 0  
Handler\_prepare 0  
Handler\_read\_first 0  
Handler\_read\_key 0  
Handler\_read\_next 0  
Handler\_read\_prev 0  
Handler\_read\_rnd 0  
Handler\_read\_rnd\_next 12  
Handler\_rollback 0  
Handler\_savepoint 0  
Handler\_savepoint\_rollback 0  
Handler\_update 0  
Handler\_write 143  
Innodb\_buffer\_pool\_pages\_data 90  
Innodb\_buffer\_pool\_pages\_dirty 0  
Innodb\_buffer\_pool\_pages\_flushed 4  
Innodb\_buffer\_pool\_pages\_free 74918  
Innodb\_buffer\_pool\_pages\_latched 0  
Innodb\_buffer\_pool\_pages\_misc 0  
Innodb\_buffer\_pool\_pages\_total 75008  
Innodb\_buffer\_pool\_read\_ahead\_rnd 1  
Innodb\_buffer\_pool\_read\_ahead\_seq 0  
Innodb\_buffer\_pool\_read\_requests 27607  
Innodb\_buffer\_pool\_reads 39  
Innodb\_buffer\_pool\_wait\_free 0  
Innodb\_buffer\_pool\_write\_requests 4  
Innodb\_data\_fsyncs 19  
Innodb\_data\_pending\_fsyncs 0  
Innodb\_data\_pending\_reads 0  
Innodb\_data\_pending\_writes 0  
Innodb\_data\_read 3657728  
Innodb\_data\_reads 100  
Innodb\_data\_writes 19  
Innodb\_data\_written 136704  
Innodb\_dblwr\_pages\_written 4  
Innodb\_dblwr\_writes 4  
Innodb\_log\_waits 0  
Innodb\_log\_write\_requests 0  
Innodb\_log\_writes 5  
Innodb\_os\_log\_fsyncs 11  
Innodb\_os\_log\_pending\_fsyncs 0  
Innodb\_os\_log\_pending\_writes 0  
Innodb\_os\_log\_written 2560  
Innodb\_page\_size 16384  
Innodb\_pages\_created 0  
Innodb\_pages\_read 90  
Innodb\_pages\_written 4  
Innodb\_row\_lock\_current\_waits 0  
Innodb\_row\_lock\_time 0  
Innodb\_row\_lock\_time\_avg 0  
Innodb\_row\_lock\_time\_max 0  
Innodb\_row\_lock\_waits 0  
Innodb\_rows\_deleted 0  
Innodb\_rows\_inserted 0  
Innodb\_rows\_read 10  
Innodb\_rows\_updated 0  
Key\_blocks\_not\_flushed 0  
Key\_blocks\_unused 28694  
Key\_blocks\_used 0  
Key\_read\_requests 0  
Key\_reads 0  
Key\_write\_requests 0  
Key\_writes 0  
Last\_query\_cost 10.499000  
Max\_used\_connections 3  
Not\_flushed\_delayed\_rows 0  
Open\_files 0  
Open\_streams 0  
Open\_tables 1  
Opened\_tables 0  
Prepared\_stmt\_count 0  
Qcache\_free\_blocks 0  
Qcache\_free\_memory 0  
Qcache\_hits 0  
Qcache\_inserts 0  
Qcache\_lowmem\_prunes 0  
Qcache\_not\_cached 0  
Qcache\_queries\_in\_cache 0  
Qcache\_total\_blocks 0  
Questions 2451  
Rpl\_status NULL  
Select\_full\_join 0  
Select\_full\_range\_join 0  
Select\_range 0  
Select\_range\_check 0  
Select\_scan 2  
Slave\_open\_temp\_tables 0  
Slave\_retried\_transactions 0  
Slave\_running OFF  
Slow\_launch\_threads 0  
Slow\_queries 0  
Sort\_merge\_passes 0  
Sort\_range 0  
Sort\_rows 0  
Sort\_scan 0  
Ssl\_accept\_renegotiates 0  
Ssl\_accepts 0  
Ssl\_callback\_cache\_hits 0  
Ssl\_cipher  
Ssl\_cipher\_list  
Ssl\_client\_connects 0  
Ssl\_connect\_renegotiates 0  
Ssl\_ctx\_verify\_depth 0  
Ssl\_ctx\_verify\_mode 0  
Ssl\_default\_timeout 0  
Ssl\_finished\_accepts 0  
Ssl\_finished\_connects 0  
Ssl\_session\_cache\_hits 0  
Ssl\_session\_cache\_misses 0  
Ssl\_session\_cache\_mode NONE  
Ssl\_session\_cache\_overflows 0  
Ssl\_session\_cache\_size 0  
Ssl\_session\_cache\_timeouts 0  
Ssl\_sessions\_reused 0  
Ssl\_used\_session\_cache\_entries 0  
Ssl\_verify\_depth 0  
Ssl\_verify\_mode 0  
Ssl\_version  
Table\_locks\_immediate 1534  
Table\_locks\_waited 0  
Tc\_log\_max\_pages\_used 0  
Tc\_log\_page\_size 0  
Tc\_log\_page\_waits 0  
Threads\_cached 1  
Threads\_connected 2  
Threads\_created 3  
Threads\_running 1  
Uptime 16477  
Uptime\_since\_flush\_status 16477
