473,385 Members | 1,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Garbage collection problem?

Hi,

When I run either of the following scripts it runs to completion and
prints "end" if $limit<=1e4. If $limit>=1e5 then somewhere after many
loops the script stops and I do not see the final message "end". Is
there garbage I should be collecting? Am I hitting a type limit? Do php
scripts have any other limit that I might be hitting?

I'm confused!

Thanks,
Peter

//////////////////////////////////////////////

<?php

$limit = 1e4;

for ($i=0; $i<$limit; $i++)
{
$foo = array();

for($j=0; $j<100; $j++)
{
$foo[] = $j;
}

}
echo 'end';

?>

//////////////////////////////////////////////

<?php

$limit = 1e4;

$foo = array();

for ($i=0; $i<$limit; $i++)
{
for($j=0; $j<100; $j++)
{
$foo[$j] = $j;
}

}
echo 'end';

?>

Oct 10 '05 #1
3 1322
Is the web browser just not willing to wait longer? Same results in
Firefox and Safari.

Peter

Oct 10 '05 #2
pe**********@yahoo.com wrote:
Hi,

When I run either of the following scripts it runs to completion and
prints "end" if $limit<=1e4. If $limit>=1e5 then somewhere after many
loops the script stops and I do not see the final message "end". Is
there garbage I should be collecting? Am I hitting a type limit? Do php
scripts have any other limit that I might be hitting?

I'm confused!

Thanks,
Peter

//////////////////////////////////////////////

<?php

$limit = 1e4;

for ($i=0; $i<$limit; $i++)
{
$foo = array();

for($j=0; $j<100; $j++)
{
$foo[] = $j;
}

}
echo 'end';

?>

//////////////////////////////////////////////

<?php

$limit = 1e4;

$foo = array();

for ($i=0; $i<$limit; $i++)
{
for($j=0; $j<100; $j++)
{
$foo[$j] = $j;
}

}
echo 'end';

?>


Or are you hitting the php timeout limit (default 30 seconds)?
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Oct 11 '05 #3
Seems like that is it. Thank you!

Peter

Oct 11 '05 #4

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

Similar topics

6
by: Ganesh | last post by:
Is there a utility by microsoft (or anyone) to force garbage collection in a process without have access to the process code. regards Ganesh
2
by: Oculus | last post by:
Before I get into the question -- I know .NET isn't the right solution for this app but it's part of my clients requirements and writing this in C++ isn't an option. That being said -- my app is a...
34
by: Ville Voipio | last post by:
I would need to make some high-reliability software running on Linux in an embedded system. Performance (or lack of it) is not an issue, reliability is. The piece of software is rather simple,...
8
by: mike2036 | last post by:
For some reason it appears that garbage collection is releasing an object that I'm still using. The object is declared in a module and instantiated within a class that is in turn instantiated by...
28
by: Goalie_Ca | last post by:
I have been reading (or at least googling) about the potential addition of optional garbage collection to C++0x. There are numerous myths and whatnot with very little detailed information. Will...
142
by: jacob navia | last post by:
Abstract -------- Garbage collection is a method of managing memory by using a "collector" library. Periodically, or triggered by an allocation request, the collector looks for unused memory...
56
by: Johnny E. Jensen | last post by:
Hellow I'am not sure what to think about the Garbage Collector. I have a Class OutlookObject, It have two private variables. Private Microsoft.Office.Interop.Outlook.Application _Application =...
350
by: Lloyd Bonafide | last post by:
I followed a link to James Kanze's web site in another thread and was surprised to read this comment by a link to a GC: "I can't imagine writing C++ without it" How many of you c.l.c++'ers use...
0
by: Kyle Lanclos | last post by:
I've done a lot of web searching, a fair bit of C-source reading, and quite a lot of miscellaneous head scratching, and I find that I am not necessarily closer to an ideal solution. I have a...
158
by: pushpakulkar | last post by:
Hi all, Is garbage collection possible in C++. It doesn't come as part of language support. Is there any specific reason for the same due to the way the language is designed. Or it is...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.