phpbar.de logo

Mailinglisten-Archive

[php] Speichergrenze fuer Arrays in PHP

[php] Speichergrenze fuer Arrays in PHP

Tino Hager live2 at gmx.at
Don Feb 16 00:01:35 CET 2006


Hab bei meinem Provider mal getestet, funktioniert bei mir also bis 700MB
ohne Probleme


lg live2

------------------------------------------------------------------



php.ini
memory_limit = 700M


php-script
for ($i=1;$i<10000000;$i += 40000) {
	echo '<div style="float:left; width:100px;">'.$i.'</div><div
style="float:left;">'.round((memory_get_usage()/1048576),2).' MB</div><div
style="clear:left;"></div>';
	for ($j=1;$j<40000;$j++) {
		$wert[] = $i+$j;
	}
	
}



1
0.02 MB
40001
4.18 MB
80001
8.35 MB
120001
12.01 MB
160001
16.67 MB
200001
20.33 MB
240001
23.99 MB
280001
29.66 MB
320001
33.32 MB
360001
36.98 MB
400001
40.64 MB
440001
44.3 MB
480001
47.97 MB
520001
51.63 MB
560001
59.29 MB
600001
62.95 MB
640001
66.61 MB
680001
70.28 MB
720001
73.94 MB
760001
77.6 MB
800001
81.26 MB
840001
84.92 MB
880001
88.59 MB
920001
92.25 MB
960001
95.91 MB
1000001
99.57 MB
1040001
103.23 MB
1080001
114.9 MB
1120001
118.56 MB
1160001
122.22 MB
1200001
125.88 MB
1240001
129.55 MB
1280001
133.21 MB
1320001
136.87 MB
1360001
140.53 MB
1400001
144.19 MB
1440001
147.86 MB
1480001
151.52 MB
1520001
155.18 MB
1560001
158.84 MB
1600001
162.5 MB
1640001
166.17 MB
1680001
169.83 MB
1720001
173.49 MB
1760001
177.15 MB
1800001
180.81 MB
1840001
184.48 MB
1880001
188.14 MB
1920001
191.8 MB
1960001
195.46 MB
2000001
199.12 MB
2040001
202.79 MB
2080001
206.45 MB
2120001
226.11 MB
2160001
229.77 MB
2200001
233.43 MB
2240001
237.1 MB
2280001
240.76 MB
2320001
244.42 MB
2360001
248.08 MB
2400001
251.74 MB
2440001
255.41 MB
2480001
259.07 MB
2520001
262.73 MB
2560001
266.39 MB
2600001
270.05 MB
2640001
273.72 MB
2680001
277.38 MB
2720001
281.04 MB
2760001
284.7 MB
2800001
288.36 MB
2840001
292.03 MB
2880001
295.69 MB
2920001
299.35 MB
2960001
303.01 MB
3000001
306.67 MB
3040001
310.34 MB
3080001
314 MB
3120001
317.66 MB
3160001
321.32 MB
3200001
324.98 MB
3240001
328.65 MB
3280001
332.31 MB
3320001
335.97 MB
3360001
339.63 MB
3400001
343.29 MB
3440001
346.96 MB
3480001
350.62 MB
3520001
354.28 MB
3560001
357.94 MB
3600001
361.6 MB
3640001
365.27 MB
3680001
368.93 MB
3720001
372.59 MB
3760001
376.25 MB
3800001
379.91 MB
3840001
383.58 MB
3880001
387.24 MB
3920001
390.9 MB
3960001
394.56 MB
4000001
398.22 MB
4040001
401.89 MB
4080001
405.55 MB
4120001
409.21 MB
4160001
412.87 MB
4200001
448.53 MB
4240001
452.2 MB
4280001
455.86 MB
4320001
459.52 MB
4360001
463.18 MB
4400001
466.84 MB
4440001
470.51 MB
4480001
474.17 MB
4520001
477.83 MB
4560001
481.49 MB
4600001
485.15 MB
4640001
488.82 MB
4680001
492.48 MB
4720001
496.14 MB
4760001
499.8 MB
4800001
503.46 MB
4840001
507.13 MB
4880001
510.79 MB
4920001
514.45 MB
4960001
518.11 MB
5000001
521.77 MB
5040001
525.44 MB
5080001
529.1 MB
5120001
532.76 MB
5160001
536.42 MB
5200001
540.08 MB
5240001
543.75 MB
5280001
547.41 MB
5320001
551.07 MB
5360001
554.73 MB
5400001
558.39 MB
5440001
562.06 MB
5480001
565.72 MB
5520001
569.38 MB
5560001
573.04 MB
5600001
576.7 MB
5640001
580.37 MB
5680001
584.03 MB
5720001
587.69 MB
5760001
591.35 MB
5800001
595.02 MB
5840001
598.68 MB
5880001
602.34 MB
5920001
606 MB
5960001
609.66 MB
6000001
613.33 MB
6040001
616.99 MB
6080001
620.65 MB
6120001
624.31 MB
6160001
627.97 MB
6200001
631.64 MB
6240001
635.3 MB
6280001
638.96 MB
6320001
642.62 MB
6360001
646.28 MB
6400001
649.95 MB
6440001
653.61 MB
6480001
657.27 MB
6520001
660.93 MB
6560001
664.59 MB
6600001
668.26 MB
6640001
671.92 MB
6680001
675.58 MB
6720001
679.24 MB
6760001
682.9 MB
6800001
686.57 MB
6840001
690.23 MB
6880001
693.89 MB
6920001
697.55 MB

Fatal error: Allowed memory size of 734003200 bytes exhausted (tried to
allocate 71 bytes) in /home/****************/speicher.php on line 6


php::bar PHP Wiki   -   Listenarchive