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 June 25th, 2002, 07:47 PM
greggory greggory is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Reims, France
Posts: 82 greggory User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Memory Limit

Is there a memory limit ?

My (recursive) script seems to be very memory consuming :-(

Reply With Quote
  #2  
Old June 25th, 2002, 07:55 PM
Zilvester Zilvester is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: London, UK
Posts: 8 Zilvester User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: Memory Limit

Matt said, "I will tweak the memory limit per a script up to 32MB" in a previous thread.

Zilvester

Reply With Quote
  #3  
Old June 25th, 2002, 09:58 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
RE: Memory Limit

same thing here, i also made a recursive script (well that seems to be the best idea) that easily chews up some 150MB at the moment. I will have to find more ways that will stop when moves are becoming stupid ;)

Reply With Quote
  #4  
Old June 25th, 2002, 10:04 PM
annuca annuca is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 27 annuca User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: Memory Limit

Every recursive function can be rewritten to be non-recursive. With PHP it is probably a lot faster as well.


Reply With Quote
  #5  
Old June 25th, 2002, 10:33 PM
noda noda is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Montreal, Quebec, Canada
Posts: 20 noda User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to noda
RE: Memory Limit

A quick tip, if anybody hasn't realized it yet: This cannot be solved by brute force.

Let's say a puzzle can be solved in around 70 moves. And let's say, on average, that each move splits into 1.5 new board layouts (since brute-force solving will give lots of identical boards). This makes ~1.5^70 = 2 120 255 184 830 board combinations after 70 moves. Let's say you've managed to fit each board into 60 bits (That's around the minimum) of memory, you're looking at 14 terabytes of information. Plus PHP is always a little more free with memory than one would wish.

Indeed, a typical script will make it to around 12 moves, at which time it'll start to take minutes to calculate the next single moves. The brute-force answer is years away.

Reply With Quote
  #6  
Old June 26th, 2002, 12:42 AM
annuca annuca is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 27 annuca User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: Memory Limit

You don't have to store stuff in memory.
You can dump to disk and index the file.

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP ContestsOlder Contests > Memory 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


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





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