|
Posted by tony on 06/12/06 14:07
In article <1150065491.103321.163960@m38g2000cwc.googlegroups.com>,
richardlev@gmail.com says...
>
> I wouldn't be surprised at all if PHP was loading the whole file into
> memory or scanning from start to finish every fgetcsv() call. Checking
> the C source code would give better insight.
>
> there are also a couple functions that will tell you the current memory
> usage by PHP. Putting those in for each iteration might give some
> insight into if its running out of memory.
>
> Maybe it is the data confusion the function, too? Unescaped quote,
> missing newline, too long of a line, etc. Something like that might
>
Thanks Richard - I looked at windows memory usage but never thought about
PHP itself - it does have a limit in the .INI file I think... I'll take a
look.
It isnt connected to the data (the csv file itself is decoded perfectly)
I've now run the process with just the drop to shell and return back
and it still slows down both on windows and linux so it is looking like
the fget function... or the loop ...(stack overflow bug?) for a while I
thought maybe it was windows but it doesn't seem to be. I changed it to
fgets and get the same result so that would seem to rule out the CSV
decoding part too.
I'm going to try just an empty file read loop but the trouble with that
is it probably isnt going to show up as it wont be doing any work. ;-(
There also seems to be a massive "flush" of something about 20 seconds
after the PHP code ends which slows windows down to a crawl for about 3
seconds - again I don't know what that is yet. Could be windows.
The other thing I've just discovered is PHP is taking 94% of processor
usage and I can't seem to change its priority in windows with the tool I
normally use for that. The number changes but PHP doesn't respond.
Can PHP be controlled for that - I dont remember reading anything in the
docs. 94% is way over the top - my real time TV capture device only uses
25%
PHP seems to have a default priority of 8 which is normal so this is
somewhat confusing too as it refuses to release to other apps.
This one is another application killer if I can't sort it ...
tony
Navigation:
[Reply to this message]
|