Bug #11070 GLib-ERROR **:gmem.c:173: failed to allocate 22720000 bytes
Submitted: 3 Jun 2005 11:40 Modified: 4 Sep 2006 12:59
Reporter: Oliver Peters Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Query Browser Severity:S2 (Serious)
Version:1.1.9 OS:Windows (Windows2000)
Assigned to: Alfredo Kojima CPU Architecture:Any

[3 Jun 2005 11:40] Oliver Peters
Description:
Doing a query:

SELECT b.`KDNR`, kp.NAME, FLOOR(kp.`G_ART`/100), b.TNR, t.NAME, b.ANR, t.`EW`, t.`WGOG`, t.`WGUG`
, b.`TB`, b.`RM`, b.`VK`
, SUM(IF(s.REMTYP_FRUEH IS NOT NULL,IFNULL(s.MNG_FRUEHSUM,0),0)) 'Fr_Expl'
, SUM(IF(s.REMTYP_FRUEH='1',IFNULL(s.MNG_FRUEHSUM,0),0)) 'Fr_sk_Expl'
, SUM(IF(s.REMTYP_FRUEH='2',IFNULL(s.MNG_FRUEHSUM,0),0)) 'Fr_k_Expl'
, SUM(IF(s.REMTYP_FRUEH='3',IFNULL(s.MNG_FRUEHSUM,0),0)) 'Fr_avk_Expl'
, SUM(IF(s.REMTYP_FRUEH='4',IFNULL(s.MNG_FRUEHSUM,0),0)) 'Fr_vk_Expl'
, t1.`ohne_Fr_EH` 'Anz EH ohne Frühremi'
, t1.`ohne_Fr_TB` 'TB EH ohne Frühremi'
, t1.`ohne_Fr_TB`/t1.`ohne_Fr_EH` 'Ø TB EH ohne Frühremi'
, t1.`ohne_Fr_RM` 'RM EH ohne Frühremi'
, t1.`ohne_Fr_RM`/t1.`ohne_Fr_EH` 'Ø RM EH ohne Frühremi'
, t1.`ohne_Fr_VK` 'VK EH ohne Frühremi'
, t1.`ohne_Fr_VK`/t1.`ohne_Fr_EH` 'Ø VK EH ohne Frühremi'
FROM `bezuege` b
LEFT JOIN kust_prov kp ON b.KDNR = kp.KDNR
LEFT JOIN tist t ON b.TNR = t.TNR
LEFT JOIN fruehsum_kat s ON b.KDNR = s.KDNR AND b.TNR = s.TNR AND b.ANR = s.ANR
LEFT JOIN titsicht_1 t1 ON b.TNR = t1.TNR AND b.ANR = t1.ANR
GROUP BY  b.`KDNR`, FLOOR(kp.`G_ART`/100), b.TNR, t.NAME, b.ANR
;

that should return approximately 3.8 records after 1,414,920 records I got the message in Synopsis

after clicking OK I got a MessageBox titled "Microsoft Visual C++ Runtime Library" with

Runtime Error!

Path...\MySQLQueryBrowser.exe

abnormal program termination

The error is reproducable

How to repeat:
do a large complex query?

Suggested fix:
I don't know
[3 Jun 2005 11:42] Oliver Peters
it's 3.8 million records (sorry, forgot the million)
[3 Jun 2005 16:04] Michael G. Zinner
The problem is that you run out of memory on your local machine. You might want to limit the number of returned rows with the LIMIT statement.

Nevertheless the error message should be more desciptive and be printed inside the normal error table.

We are going to auto limit the number of returned rows to a percentage of the available main memory, e.g. 40%. If the number of rows fetched require more memory than that, we will print the error message.
[4 Sep 2006 12:59] Alfredo Kojima
Thank you for your bug report. This issue has already been fixed in the latest released version of that product, which you can download at

  http://www.mysql.com/downloads/