Toon posts:

[php] Hoeveel mem gebruikt mijn script?

Pagina: 1
Acties:

Verwijderd

Topicstarter
Is er een methode om te zien hoeveel memory een script gebruikt? of een methode om te zien hoeveel ruimte (bytes) een array lost? Ik gebruik vele arrays om tables compleet op te slaan voor bewerking. (Ik heb niet echt veel zin om met memory_limit het gebruik uit te vinden...)

Verwijderd

Move: [forum=13] -> [forum=14]

Verwijderd

Topicstarter
whoops, verkeerde forum aangeklikt |:(

Verwijderd

ik zou het niet direct weten... missschien even in een bestand wegschrijven en dan de grootte van het bestand als maatstaf nemen?

  • DRvDijk
  • Registratie: Juni 2001
  • Laatst online: 12-02 15:52
Ik weet niet.. Mijn updatescript duurt 3 minuten.. Dat kan ik zien in het programma top, op een Linux-machine.. Ik denk dat daar ook wel het geheugengebruik bijstaat?
En in Windows NT (dus ook 2000 en XP) heb je natuurlijk de Task Manager, waarbij je per proces ook kan zien hoeveel geheugen het gebruikt.. Moet je script alleen lang genoeg duren om het te kunnen zien :P

  • Soultaker
  • Registratie: September 2000
  • Laatst online: 18:31
http://php.net/getrusage
man rusage:
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
     ru_maxrss    the maximum resident set size utilized (in kilobytes).

     ru_ixrss     an ``integral'' value indicating the amount of memory used
            by the text segment that was also shared among other pro-
            cesses.  This value is expressed in units of kilobytes *
            ticks-of-execution.  Ticks are statistics clock ticks.  The
            statistics clock has a frequency of sysconf(_SC_CLOCK_TCK)
            ticks per second.

     ru_idrss     an integral value of the amount of unshared memory residing
            in the data segment of a process (expressed in units of
            kilobytes * ticks-of-execution).

     ru_isrss     an integral value of the amount of unshared memory residing
            in the stack segment of a process (expressed in units of
            kilobytes * ticks-of-execution).
Bij gebrek aan rusage in Windows, werkt 't alleen onder Unix-achtigen.
Pagina: 1