Skip to content

Fix unnecesary memory usage when reallocating#847

Merged
mzient merged 2 commits intoNVIDIA:masterfrom
mzient:ScratchAllocNoDoubleMem
May 6, 2019
Merged

Fix unnecesary memory usage when reallocating#847
mzient merged 2 commits intoNVIDIA:masterfrom
mzient:ScratchAllocNoDoubleMem

Conversation

@mzient
Copy link
Contributor

@mzient mzient commented May 6, 2019

We don't assume that buffer contents are maintained accross allocation - as such, we can free the memory before attempting to allocate a new buffer.

Signed-off-by: Michal Zientkiewicz michalz@nvidia.com

…allocatedScratchpad`.

Signed-off-by: Michal Zientkiewicz <michalz@nvidia.com>
@mzient mzient force-pushed the ScratchAllocNoDoubleMem branch from 8f2617a to fb1ed19 Compare May 6, 2019 10:38
@mzient
Copy link
Contributor Author

mzient commented May 6, 2019

!build

@JanuszL JanuszL changed the title Fix unnecesary memory usage when reallocating scratchpad. Fix unnecesary memory usage when reallocating May 6, 2019
@dali-automaton
Copy link
Collaborator

CI MESSAGE: [726586]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [726588]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [726586]: BUILD FAILED

Signed-off-by: Michal Zientkiewicz <michalz@nvidia.com>
@mzient mzient force-pushed the ScratchAllocNoDoubleMem branch from 9450b71 to 8c5c939 Compare May 6, 2019 12:34
@mzient mzient requested review from jantonguirao and klecki May 6, 2019 12:40
@dali-automaton
Copy link
Collaborator

CI MESSAGE: [726685]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [726685]: BUILD PASSED

@mzient mzient merged commit 6f7f56c into NVIDIA:master May 6, 2019
@mzient mzient deleted the ScratchAllocNoDoubleMem branch May 6, 2019 14:41
kychennv pushed a commit to kychennv/DALI that referenced this pull request May 14, 2019
* Free memory before allocating new, larger buffer in `Buffer` and `PreallocatedScratchpad`.
* Fix tests explicitly expecting pointer change.

Signed-off-by: Michal Zientkiewicz <michalz@nvidia.com>
Signed-off-by: kychennv <kychen@nvidia.com>
haoxintong pushed a commit to haoxintong/DALI that referenced this pull request Jul 16, 2019
* Free memory before allocating new, larger buffer in `Buffer` and `PreallocatedScratchpad`.
* Fix tests explicitly expecting pointer change.

Signed-off-by: Michal Zientkiewicz <michalz@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants