Older Contests
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP ContestsOlder Contests

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old May 29th, 2004, 01:54 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
[appleeaters]32 mb limit?

I was wondering if there was a way to limit my script to 32 mb while testing, also i wanted to know if php would slow down to comphensate for memory it a script tried to go over the limit, or will it just go over and have itself disqualified.

Sry if this post comes up twice. I tried posting before but i didnt see it come up.

Reply With Quote
  #2  
Old May 29th, 2004, 07:09 PM
Cypher Cypher is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 40 Cypher User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via ICQ to Cypher Send a message via Yahoo to Cypher
[appleeaters]RE: 32 mb limit?

I really think that the 32 mb limit is way MORE than we need, so you shouldnt have to worry about it. I believe by default, php will limit itself to ~8mb of memory after which point it will crap out. If you require more than this, I would suggest re-evaluating your algorithms, and make sure that your not making copies of things that you could be referencing directly.

For instance, dont pass into a function the entire robots or apples array. Instead, make it a global variable or pass a reference. You should really only need to have one copy of the map stored in memory at any given time, and since we dont have any 32mb maps, I think we should be fine.

Reply With Quote
  #3  
Old May 29th, 2004, 07:39 PM
fidian fidian is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 45 fidian User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
[appleeaters]RE: 32 mb limit?

I believe this will do it.
php Code:
Original - php Code
  1. ini_set('memory_limit', '32M');

Reply With Quote
  #4  
Old May 29th, 2004, 08:00 PM
austinb austinb is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: TX
Posts: 59 austinb User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
[appleeaters]RE: 32 mb limit?

wow thanks. I wasnt really sure how much php usually uses up. is there a way i can measure how much my script askes for?

Reply With Quote
  #5  
Old May 30th, 2004, 06:25 AM
cirox cirox is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 7 cirox User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to cirox
[appleeaters]RE: 32 mb limit?

Depends on your environment. If you're using WinNT, just open the task manager, flip to the processes tab and watch the CPU and memory usage. For Linux, memory usage can be found via the "ps" command. Sad that Linux doesn't capture the ctrl+alt+del event and turn it into something more useful instead of resetting the computer, but hey, that's how it goes.

Reply With Quote
  #6  
Old June 11th, 2004, 05:50 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
[appleeaters](Slightly Off Topic) Linux Ctrl-Alt-Del

Linux will allow you to do whatever you want with a detected Ctrl-Alt-Del. In the file /etc/inittab, there is a line starting with 'ca:' that defines the behavior when the Ctrl-Alt-Del is detected. Typically it is defined to 'shutdown -r now', but you can change that behavior to whatever you want.

Reply With Quote
  #7  
Old June 11th, 2004, 07:44 PM
cirox cirox is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 7 cirox User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to cirox
[appleeaters]RE: 32 mb limit?

Thanks for the tip!

Reply With Quote
  #8  
Old June 12th, 2004, 08:26 PM
Cypher Cypher is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 40 Cypher User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via ICQ to Cypher Send a message via Yahoo to Cypher
[appleeaters]RE: 32 mb limit?

In KDE you can do ctrl-alt-esc and it will bring you a kill cursor that lets you kill anything you click (btw, dont click the desktop).

If you do just ctrl-esc it will bring you to a process list where you can see memory usage and stuff.

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP ContestsOlder Contests > [appleeaters]32 mb limit?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five &quot;checkpoints&quot; for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway