|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
[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. |
|
#2
|
|||
|
|||
|
[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. |
|
#4
|
|||
|
|||
|
[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?
|
|
#5
|
|||
|
|||
|
[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.
|
|
#6
|
|||
|
|||
|
[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.
|
|
#7
|
|||
|
|||
|
[appleeaters]RE: 32 mb limit?
Thanks for the tip!
|
|
#8
|
|||
|
|||
|
[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. |
![]() |
| Viewing: Codewalkers Forums > PHP Contests > Older Contests > [appleeaters]32 mb limit? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|