8000 Release memory for the parsed data after parsing by stof · Pull Request #22086 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Release memory for the parsed data after parsing #22086

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

Merged
merged 1 commit into from
Mar 21, 2017

Conversation

stof
Copy link
Member
@stof stof commented Mar 21, 2017
Q A
Branch? master
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets n/a
License MIT
Doc PR n/a

If the Dotenv instance outlives the parsing of the file (which is the case easily in the usage described in the documentation as it is used in the global scope and so the variable does not go out of scope until the end of the process), there is no reason to keep the parsed data in memory after the end of the parsing.

I have not reset the integer properties, as this would not save any memory anyway (integers are inline inside the ZVAL anyway)

Copy link
Member
@xabbuh xabbuh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@fabpot
Copy link
Member
fabpot commented Mar 21, 2017

Thank you @stof.

@fabpot fabpot merged commit 518f618 into symfony:master Mar 21, 2017
fabpot added a commit that referenced this pull request Mar 21, 2017
This PR was merged into the 3.3-dev branch.

Discussion
----------

Release memory for the parsed data after parsing

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

If the Dotenv instance outlives the parsing of the file (which is the case easily in the usage described in the documentation as it is used in the global scope and so the variable does not go out of scope until the end of the process), there is no reason to keep the parsed data in memory after the end of the parsing.

I have not reset the integer properties, as this would not save any memory anyway (integers are inline inside the ZVAL anyway)

Commits
-------

518f618 Release memory for the parsed data after parsing
@stof stof deleted the dotenv_cleanup branch March 21, 2017 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0