# does 16M give a counting overhead ?

- Thread: https://externals.io/message/25054
- Original archive: https://news-web.php.net/php.internals/25054
- Started by bertrand Gugger on 2006-07-29T18:08:51+00:00
- Messages: 3
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #25054 — bertrand Gugger — 2006-07-29T18:08:51+00:00

URL: https://externals.io/message/25054#25054

Bonsoir,
I sure bore the list , but I still miss something.
There was that thread about "memory_get_usage with new Memory Manager" 
where Ilia (et al.) evocated the overhead induced by the 
 `memory_get_usage()` and family functions.
as , e.g. , in http://marc.theaimsgroup.com/?l=php-dev&m=115400370218834

So I just ask if and how it is possible to get 16M without the counting 
overhead.
--
toggg

> Ilia Alshanetsky wrote:
> 
> > […]
> 
> The most cases I saw were providers or production site wanting to grant *more* than 8M (typically 16M) to their customers / users.
> I dont call that a "restriction".
> You should know this 8M limit is reached very easily.
> e.g. lot of popular CMS wont work below this limit as soon as they have a litle contents.
> 
> > […]
> 
> You miss the point , they don't care about accuracy,
> they just don't want the default 8M but more.
> 
> > […]
> 
> I have no idea how it works internally ...
> Are you meaning the default "hard-coded" 8M limit is magic and will not need to count the amount of memory consumed but any custom setting will ?
> -- 
> toggg

---

## #25055 — Andi Gutmans — 2006-07-29T19:42:22+00:00

URL: https://externals.io/message/25054#25055 · In reply to: #25054

Hi Bertrand,

The discussion is on how and what we count, not on whether to count or not.
If you count in 256KB increments instead of in byte increments then there's
less counting to do in order to get to 16MB :)
Andi 

> -----Original Message-----
> From: bertrand Gugger [mailto:bertrand@toggg.com] 
> Sent: Saturday, July 29, 2006 11:09 AM
> To: internals@lists.php.net
> Subject: [PHP-DEV] does 16M give a counting overhead ?
> 
> Bonsoir,
> I sure bore the list , but I still miss something.
> There was that thread about "memory_get_usage with new Memory 
> Manager" 
> where Ilia (et al.) evocated the overhead induced by the
> `memory_get_usage()` and family functions.
> as , e.g. , in 
> http://marc.theaimsgroup.com/?l=php-dev&m=115400370218834
> 
> So I just ask if and how it is possible to get 16M without 
> the counting overhead.
> --
> toggg
> 
> > […]
> else than 8M  *without* getting this counting overhead ?
> > […]
> my  experience most of the time this setting is used by 
> hosting providers  to restrict memory utilization of various 
> PHP scripts to avoid out-of- memory situations and system abuse.
> > […]
> wanting to grant *more* than 8M (typically 16M) to their 
> customers / users.
> > […]
> as they have a litle contents.
> > […]
> including any overhead and what not, since it  is possible to 
> use the overhead to exceed or in some cases even to  bypass 
> the memory limit entirely.
> > […]
> just don't 
> > […]
> independant roles :
> > […]
> eventually  
> > […]
> to count the  amount of memory consumed, since such tracking 
> is performed it  enabled PHP to report internally via 
> functions (or via Apache log)  about its memory utilization.
> > […]
> and will not need to count the amount of memory consumed but 
> any custom setting will ?
> > […]
> 
> --
>  To 
> unsubscribe, visit: http://www.php.net/unsub.php

---

## #25057 — bertrand Gugger — 2006-07-29T20:10:09+00:00

URL: https://externals.io/message/25054#25057 · In reply to: #25055

Andi Gutmans wrote:
> Hi Bertrand,
> 
> The discussion is on how and what we count, not on whether to count or not.
The quoted discussion is/was , this one is about the possibility to get 
16M without counting.
> If you count in 256KB increments instead of in byte increments then there's
> less counting to do in order to get to 16MB :)
Is the hardcoded 8M counting that way ?
( I mean , without --enable-memory-limit )
--
toggg
