473,503 Members | 1,639 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

memory size exhausted error - Too much info back from query - what to do?

Hi there,
I changed one of my MySQL search queries to allow a situation where the user
gets much more information returned.

However, it has now given me the error message:
Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to
allocate 42 bytes) in /usr/share/pear/DB/mysql.php on line 290

OK I understand what this means (I assume) that the program is trying to
allocate more memory to return my query result but it wont let it.

However, I need this query to return this info, so what can I do?

Any help / explanations appreciated.

Kind regards

Dave.
Nov 22 '05 #1
3 2053
sorry, no help here, but just wondering...
Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to


what are you searching for? what is in that database?

let say you have some ...books in your database. few thousands of
them... whouldn't it be better for query to return just headlines, and
maybe introduction or summary? and link to the whole think instead of
returning that huge amount of data?

--
Ja NE
http://fotozine.org/?omen=janimir
--
Nov 22 '05 #2
Hi,

sounds like you should use LIMIT or use unbuffered queries
(http://us2.php.net/mysql_unbuffered_query)

If you use unbuffered queries be sure you read the notes about
mysql_num_rows().

Nov 22 '05 #3
Following on from Dave Smithz's message. . .

Firstly
Mysql will let you retrieve a bit at a time. Something like LIMIT -
RTFM SELECT syntax. This will open other options for getting results.

Secondly
Are you properly disposing of previous large result sets as a matter of
course. ISTR that PHP does GC at end of script by default and possibly
sql allocations cascade later from these.

Thirdly
PRUNE! Any user who can interpret 16Mb of data doesn't need a database
- they have a brain the size of a planet anyway!. (Possibly cut out
blobs from the query and retrieve a bit at a time.?)
Hi there,
I changed one of my MySQL search queries to allow a situation where the user
gets much more information returned.

However, it has now given me the error message:
Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to
allocate 42 bytes) in /usr/share/pear/DB/mysql.php on line 290

OK I understand what this means (I assume) that the program is trying to
allocate more memory to return my query result but it wont let it.

However, I need this query to return this info, so what can I do?

Any help / explanations appreciated.

Kind regards

Dave.


--
PETER FOX Not the same since the bridge building business collapsed
pe******@eminent.demon.co.uk.not.this.bit.no.html
2 Tees Close, Witham, Essex.
Gravity beer in Essex <http://www.eminent.demon.co.uk>
Nov 22 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
12343
by: Paul | last post by:
Hi, I'm using TikiWiki and was using its file upload feature, trying to upload a 2MB file. I get this error: Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate...
2
4671
by: Phil Powell | last post by:
Actually the client is saying it sometimes happens and sometimes doesn't happen, and when they refresh their screen it clears itself (I assume the memory clears). Here is line 1135: $result =...
3
2229
by: Ron Eggler | last post by:
Hi, I'm trying to resize a pic with the Code pasted below and get following Error, why, how to resize it correctly??? src:...
5
2191
by: Aaron Birkland | last post by:
I have a long but straightforward query (on some very large tables) that always ends in 'Memory exhausted in AllocSetAlloc(108)'. Even stranger are some messages that appear in the logfile, such...
4
5968
by: Sean Shanny | last post by:
To all, Running into an out of memory error on our data warehouse server. This occurs only with our data from the 'September' section of a large fact table. The exact same query running over...
0
1095
by: Gregory.Spencer | last post by:
Hi there, Using PHP and MYSQL I changed one of my MySQL search queries to allow a situation where the user gets much more information returned then previously However, it has now given me the...
3
6690
by: f.amann | last post by:
hi there! i save images in a mysql db and i wrote a script called getimage.php to display them. in my getimage.php i want to resize my images to display them as thumbnails but there always...
8
18710
by: johnlichtenstein | last post by:
I am using cx_Oracle and MySQLdb to pull a lot of data from some tables and I find that the cursor.execute method uses a lot of memory that never gets garbage collected. Using fetchmany instead of...
5
24598
by: kumarmdb2 | last post by:
Hi guys, For last few days we are getting out of private memory error. We have a development environment. We tried to figure out the problem but we believe that it might be related to the OS...
0
7202
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7084
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7278
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7328
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7458
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5578
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3154
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1512
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
380
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.