Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:54345 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 43206 invoked from network); 4 Aug 2011 10:17:35 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Aug 2011 10:17:35 -0000 Authentication-Results: pb1.pair.com smtp.mail=lester@lsces.co.uk; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=lester@lsces.co.uk; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lsces.co.uk from 213.123.26.185 cause and error) X-PHP-List-Original-Sender: lester@lsces.co.uk X-Host-Fingerprint: 213.123.26.185 c2beaomr07.btconnect.com Received: from [213.123.26.185] ([213.123.26.185:28916] helo=mail.btconnect.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5B/14-18399-DB17A3E4 for ; Thu, 04 Aug 2011 06:17:34 -0400 Received: from [10.0.0.4] (host81-138-11-136.in-addr.btopenworld.com [81.138.11.136]) by c2beaomr07.btconnect.com (MOS 4.2.2-FCS) with ESMTP id DWP83746; Thu, 4 Aug 2011 11:17:22 +0100 X-Mirapoint-IP-Reputation: reputation=Fair-1, source=Queried, refid=tid=0001.0A0B0302.4E3A71B2.0065, actions=tag Message-ID: <4E3A71B2.3060302@lsces.co.uk> Date: Thu, 04 Aug 2011 11:17:22 +0100 User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.19) Gecko/20110420 SUSE/2.0.14-2.2 SeaMonkey/2.0.14 MIME-Version: 1.0 To: PHP internals Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Junkmail-Premium-Raw: score=7/50, refid=2.7.2:2011.8.4.85414:17:7.586, ip=81.138.11.136, rules=__MOZILLA_MSGID, __HAS_MSGID, __SANE_MSGID, __USER_AGENT, __MIME_VERSION, __TO_MALFORMED_2, __CT, __CT_TEXT_PLAIN, __CTE, __ANY_URI, __URI_NO_MAILTO, __CP_URI_IN_BODY, __CP_MEDIA_2_BODY, BODY_SIZE_1700_1799, BODYTEXTP_SIZE_3000_LESS, __MIME_TEXT_ONLY, RDNS_GENERIC_POOLED, BODY_SIZE_5000_LESS, RDNS_SUSP_GENERIC, RDNS_SUSP, BODY_SIZE_2000_LESS, BODY_SIZE_7000_LESS X-Junkmail-Status: score=10/50, host=c2beaomr07.btconnect.com X-Junkmail-Signature-Raw: score=unknown, refid=str=0001.0A0B020B.4E3A71BA.0110,ss=1,fgs=0, ip=0.0.0.0, so=2010-07-22 22:03:31, dmn=2009-09-10 00:05:08, mode=multiengine X-Junkmail-IWF: false Subject: Memory management ... From: lester@lsces.co.uk (Lester Caine) I'm still trying to get my head around this 'Weak Reference' thing, but since I'm still working to be compatible with PHP5.2 then I've not taken much notice of this 'garbage collection' stuff. So this may be where I am missing something? I manage what material I need using a list of numbers, and create objects as and when they are required, pulling the detail from the database. There is a limit on the amount of memory available, so in the past I got 'out of memory', now I just say 'some detail not available'. If I'm out of space, then I reuse an existing object that is 'invalid', but to simplify things then much of the time I don't ACTUALLY need the full record, and simply build the page via the one object which is sequentially loaded ... slower, but memory efficient. Never do 'SELECT * FROM', always specify just the fields you need at that time. So it looks like the question I should be asking is "How do you 'drop' an object?" I think my take on this 'Weak Reference' stuff is that it does not actually 'create' the object? But I am creating the object because I need to use it, not because I may need it later? I'll get the database server to do any heavy processing ... and that may well be a different machine ... I just want the results. So I try to avoid pulling unnecessary data into the PHP side - I can only put so much on a client page. -- Lester Caine - G8HFL ----------------------------- Contact - http://lsces.co.uk/wiki/?page=contact L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve - http://enquirysolve.com/ Model Engineers Digital Workshop - http://medw.co.uk// Firebird - http://www.firebirdsql.org/index.php