memory-management

How to expand allocated memory in place

旧街凉风 提交于 2020-12-05 20:05:31
问题 Is there something like std::realloc but do nothing if it fails to expand the existing memory (of course it will let you know it failed)? I mean truly expand in place. Not copy to a newly created memory chunk. 回答1: Contrary to what other answers say, the function you need could be provided by the C standard ibrary. It isn't for some reason or other. It was considered for an adition to the C standard, see e.g. http://www.open-std.org/JTC1/SC22/wg14/www/docs/n1527.pdf (search for try_realloc).

Delphi FreeAndNil: Looking for an alternate implementation

偶尔善良 提交于 2020-12-05 12:24:53
问题 NOTE: Bear with me, I feel a little "flame grilled" due to some discussions over here and here and some issues I reported here and here. Some background Ye olde (pre 10.4) FreeAndNil looked like this: FreeAndNil(var SomeObject) The new and fresh FreeAndNil looks like this: FreeAndNil(const [ref] SomeObject: TObject); IMO both have their downsides: The old one doesn't do any type checking, so calling FreeAndNil on pointers, records and interfaces compiles just fine, but produces interesting

Delphi FreeAndNil: Looking for an alternate implementation

微笑、不失礼 提交于 2020-12-05 12:23:11
问题 NOTE: Bear with me, I feel a little "flame grilled" due to some discussions over here and here and some issues I reported here and here. Some background Ye olde (pre 10.4) FreeAndNil looked like this: FreeAndNil(var SomeObject) The new and fresh FreeAndNil looks like this: FreeAndNil(const [ref] SomeObject: TObject); IMO both have their downsides: The old one doesn't do any type checking, so calling FreeAndNil on pointers, records and interfaces compiles just fine, but produces interesting

Python H2O Memory Management

ε祈祈猫儿з 提交于 2020-12-05 09:35:28
问题 Similar to this question in R here, I get out of memory issues when running loops with grid search in H2O. In R, doing gc() during each loop did help. What is the proposed solution here? 回答1: There appears to be no h2o.gc() function in the Python API. See "How can I debug memory issues?" in the FAQ. You could POST that back-end command ( GarbageCollect ) directly using the REST API if you suspect the problem is the back-end holding on to memory that it no longer should be. Studying the

Python H2O Memory Management

一世执手 提交于 2020-12-05 09:35:12
问题 Similar to this question in R here, I get out of memory issues when running loops with grid search in H2O. In R, doing gc() during each loop did help. What is the proposed solution here? 回答1: There appears to be no h2o.gc() function in the Python API. See "How can I debug memory issues?" in the FAQ. You could POST that back-end command ( GarbageCollect ) directly using the REST API if you suspect the problem is the back-end holding on to memory that it no longer should be. Studying the