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
 
Unread Codewalkers Forums Sponsor:
  #1  
Old May 29th, 2004, 02: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: 25
[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, 08: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: 3
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, 08: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: 3
[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, 09: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: 3
[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, 07: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, 06: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: 25
[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, 08: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, 09: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: 3
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!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

Request Your Free Technology Downloads!
 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

Request Your Free Technology Downloads!
 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

Request Your Free Technology Downloads!
 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

Request Your Free Technology Downloads!
 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

Request Your Free Technology Downloads!
 

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




© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek