Skip to content

Commit

Permalink
empty the raw response string after parsing (#1588)
Browse files Browse the repository at this point in the history
Data between string and parsed array duplicates the memory consumption.
  • Loading branch information
dbu authored and p365labs committed Jan 9, 2019
1 parent 0cb203d commit 924c8f9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ All notable changes to this project will be documented in this file based on the

### Improvements

* Reduced memory footprint of response by not keeping the raw JSON data when JSON after JSON has been parsed. [#1588](https://github.com/ruflin/Elastica/pull/1588)

### Deprecated

## [6.1.0](https://github.com/ruflin/Elastica/compare/6.0.2...6.1.0)
Expand Down
1 change: 1 addition & 0 deletions lib/Elastica/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ public function getData()
}

$this->_response = $response;
$this->_responseString = '';
}

return $this->_response;
Expand Down

0 comments on commit 924c8f9

Please sign in to comment.