I cannot transfer an amount of data (~500 MB) for XY to deal with using clipboard as source, setting it as a variable
I can't make readfile() to read a file containing such data.
What are the limits? Documentation doesn't mention any.
It should be limited by RAM available amount only, isn't it?
Problem reading large files.
-
admin
- Site Admin
- Posts: 67270
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
-
tiago
- Posts: 589
- Joined: 14 Feb 2011 21:41
Re: Problem reading large files.
But there is memory, in one machine I had 4 GB and got the same for ~500/~700 MB files, one per script execution.Error: 7 (<several zeroes>7)
Desc: Out of Memory
Dll: 0
Proc: script_Process
The error pops after a minute or so of script execution at the readfile() execution.
Same goes with a v.9.90 version (current: 10.40.0101).
Power-hungry user!!!
-
admin
- Site Admin
- Posts: 67270
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Problem reading large files.
What you do with scripting is scary once again.
An out-of-memory error is usually not something I can fix in my code. It's a limit that's bigger than me.
Nevertheless, theoretically ReadFile should be able to handle "4GB minus 1" bytes. Without seeing your code it's not possible to say what's going on.
An out-of-memory error is usually not something I can fix in my code. It's a limit that's bigger than me.
Nevertheless, theoretically ReadFile should be able to handle "4GB minus 1" bytes. Without seeing your code it's not possible to say what's going on.
FAQ | XY News RSS | XY X
-
tiago
- Posts: 589
- Joined: 14 Feb 2011 21:41
Re: Problem reading large files.
Not a big deal.
I thought the problem was related to variables not accepting such a large input.
This will do the same anyway and prove that the problem is limited to readfile():
Same goes if you happen to have a large .avi file as <curitem>. Save your precious time.
Yet to test at which (fixed?) size of file the error begins to happen.
Code to generate a dummy file:
I thought the problem was related to variables not accepting such a large input.
This will do the same anyway and prove that the problem is limited to readfile():
Code: Select all
readfile(<curitem>); echo "ok";Yet to test at which (fixed?) size of file the error begins to happen.
Code to generate a dummy file:
Code: Select all
//default values will generate a 64 MB file
//watch out as it is memory hungry.
$trgt = "25"; // '25' creates a 64 MB file...
$data = "10";
writefile("Dummy.txt", "$data", o); // ensure it's clean
$ctrl = 1;
WHILE ($ctrl <= $trgt) {
status "Op $ctrl/$trgt done...";
writefile("Dummy.txt", "$data", a);
$data = readfile("Dummy.txt");
$ctrl++;
}
echo "task finished";Power-hungry user!!!
XYplorer Beta Club