memory-management

Cupy freeing unified memory

你说的曾经没有我的故事 提交于 2021-02-10 14:30:07
问题 I have a problem with freeing allocated memory in cupy. Due to memory constraints, I want to use unified memory. When I create a variable that will be allocated to the unified memory and want to free it, it is labelled as being freed and that the pool is now empty, to be used again, but when I take a look at a resource monitor, the memory is still not freed. When I create another variable it also adds to memory (I thought that perhaps the memory labelled as taken would be reused as is

Cupy freeing unified memory

|▌冷眼眸甩不掉的悲伤 提交于 2021-02-10 14:29:07
问题 I have a problem with freeing allocated memory in cupy. Due to memory constraints, I want to use unified memory. When I create a variable that will be allocated to the unified memory and want to free it, it is labelled as being freed and that the pool is now empty, to be used again, but when I take a look at a resource monitor, the memory is still not freed. When I create another variable it also adds to memory (I thought that perhaps the memory labelled as taken would be reused as is

Member function memory allocation stack or heap?

那年仲夏 提交于 2021-02-10 12:57:23
问题 I'm trying to allocate an array as follows: class foo{ public: void func(){double arr[13][64][64][64];} }; int main() { foo* inst = new foo(); inst->func(); return 0; } I was under the impression from answer such as: Does this type of memory get allocated on the heap or the stack? that the array arr would be placed on the heap (as the instance of the class is on the heap). This doesn't seem to be the case as I get a segmentation fault. If I change a's declaration to: double* arr = new double

Member function memory allocation stack or heap?

こ雲淡風輕ζ 提交于 2021-02-10 12:56:24
问题 I'm trying to allocate an array as follows: class foo{ public: void func(){double arr[13][64][64][64];} }; int main() { foo* inst = new foo(); inst->func(); return 0; } I was under the impression from answer such as: Does this type of memory get allocated on the heap or the stack? that the array arr would be placed on the heap (as the instance of the class is on the heap). This doesn't seem to be the case as I get a segmentation fault. If I change a's declaration to: double* arr = new double

c++ 12bit variable, how can I do this?

只谈情不闲聊 提交于 2021-02-10 06:21:50
问题 I'm building a voxel engine so I have concerns about memory usage, using 12bit instead of 16bit block ids could save a lot of memory. I have a 3D array of block ids, each id has a static configuration. I'm not sure what a good way to achieve this would be. Is there a way to just get a block of raw memory and manage it myself and would this be a good idea; are there any problems I might run into? Is there a better way to do this? I have some experience with c++, but most of my time was spent

c++ 12bit variable, how can I do this?

落花浮王杯 提交于 2021-02-10 06:21:10
问题 I'm building a voxel engine so I have concerns about memory usage, using 12bit instead of 16bit block ids could save a lot of memory. I have a 3D array of block ids, each id has a static configuration. I'm not sure what a good way to achieve this would be. Is there a way to just get a block of raw memory and manage it myself and would this be a good idea; are there any problems I might run into? Is there a better way to do this? I have some experience with c++, but most of my time was spent

Stack memory management in Linux

空扰寡人 提交于 2021-02-10 03:11:41
问题 I have a few questions related to limitations on the stack size for Linux. I'm most interested in x86_64 systems, but if there are platform differences I'd like to understand them as well. My questions are: 1) How does Linux dynamically increase the size of the stack? I've written a test program with a recursive function (to use stack space) where I can specify the number of iterations as a command line parameter. The program pauses waiting for user input after finishing the recursion, which

Stack memory management in Linux

自闭症网瘾萝莉.ら 提交于 2021-02-10 03:09:26
问题 I have a few questions related to limitations on the stack size for Linux. I'm most interested in x86_64 systems, but if there are platform differences I'd like to understand them as well. My questions are: 1) How does Linux dynamically increase the size of the stack? I've written a test program with a recursive function (to use stack space) where I can specify the number of iterations as a command line parameter. The program pauses waiting for user input after finishing the recursion, which

Stack memory management in Linux

烈酒焚心 提交于 2021-02-10 03:09:08
问题 I have a few questions related to limitations on the stack size for Linux. I'm most interested in x86_64 systems, but if there are platform differences I'd like to understand them as well. My questions are: 1) How does Linux dynamically increase the size of the stack? I've written a test program with a recursive function (to use stack space) where I can specify the number of iterations as a command line parameter. The program pauses waiting for user input after finishing the recursion, which

What is the page size for 32 and 64 bit versions of windows Os?

非 Y 不嫁゛ 提交于 2021-02-08 14:11:34
问题 I want to know the default page size for virtual memory in windows Os for both 32 and 64 bit versions. For ex: the page size of Linux (x86) is 4 Kb . 回答1: call GetSystemInfo or better GetNativeSystemInfo and look for dwPageSize member of SYSTEM_INFO structure. however now under windows in both x86 and x64 page size is 0x1000 or 4Kb 来源: https://stackoverflow.com/questions/44520047/what-is-the-page-size-for-32-and-64-bit-versions-of-windows-os