-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory problem with SQL Logs #321
Comments
The log is collected in the memory. How to solve this? No idea, as the getter for the Log imho is inconsistent: passing |
I also think that the behaviour of this feature could be improved. IMHO, sql logging should be disabled by default. After all this is a debugging feature and the |
I will leave it to whatever the consensus is. |
+1 for disabling by default well, any solution is somehow ugly:
still a way to reset the log is missing. |
Well if we want to do this properly, we need to give the possibility to perform 4 actions:
This can't be done without breaking BC so I suggest to tag this issue for v4 and fix it properly when time will come. This is not a blocking issue anyway. |
Or maybe a buffer, like only the last 50 queries? ;) |
After introducing a buffer someone will ask for a configuration option to bump up the buffer size to
|
For now these are all just ideas: But when we got enough pro+cons, it could end up in something beautiful, even if it will only be in v4, but the ideas now can shape the future ;) |
V4, i do hope we will get to this V4 someday. |
Hi,
I have a cli script, that runs through a big (12000 items) json file and updates a mysql database. After 200 entries the script dies with the info that sql.php line 230 tried to allocate X of memory. (Sorry I don't remember the exact words)
This is line 230:
This is my script (simplified)
After I set a var_dump($this->log) on sql.php:230 I saw that
$this->log
just grows (exec time and queries) and then hits the php memory limit.I know that this is intended, to profile SQL calls, but since logging is on by default, it was confusing to see the script crash and not really knowing why.
With logging turned off
$this->db->log(FALSE);
it seems to work.So I wonder if I made a mistake in my application? Or should the documentation mention this? Or is this an edge case?
Thanks. Marcus
The text was updated successfully, but these errors were encountered: