heap

Do the Stack and Heap both exist within your systems RAM?

半世苍凉 提交于 2020-01-05 12:13:26
问题 The question is pretty much the same as the title, do the Stack and Heap exist within the RAM at all times? Assuming Windows is the OS of the machine in question. Also, if the answer to the above question is yes, is it possible to tell the JVM to create a specific applications Stack and Heap in a different location, such as an external micro SD card? Or to just set the default Stack/Heap creation location to some location other than RAM? 回答1: Well, they might not be in RAM at all times. The

Do the Stack and Heap both exist within your systems RAM?

别说谁变了你拦得住时间么 提交于 2020-01-05 12:12:12
问题 The question is pretty much the same as the title, do the Stack and Heap exist within the RAM at all times? Assuming Windows is the OS of the machine in question. Also, if the answer to the above question is yes, is it possible to tell the JVM to create a specific applications Stack and Heap in a different location, such as an external micro SD card? Or to just set the default Stack/Heap creation location to some location other than RAM? 回答1: Well, they might not be in RAM at all times. The

How does V8 manage its heap?

可紊 提交于 2020-01-05 10:09:52
问题 I know when V8's Garbage Collection is working, it will trace from GC's root so that unreachable objects will be marked and then be swept. My question is how GC traverses traverse those objects? There must be a data structure to store all objects reachable or unreachable. Bitmap? Linked table? BTW, does JVM do the same? 回答1: AllenShow, Google's V8 Heap is organized into a couple of different spaces. There's a great post, "A tour of V8: Garbage Collection" which explains how the V8 heap is

Heap sort algorithm

蹲街弑〆低调 提交于 2020-01-05 09:35:22
问题 I have a heap made of a binary tree. Its not an array. I was wondering how would i go about sorting this. I know i need to take the last node and place it at the root and do a down heap bubble. This part i have. The problem I am having is knowing how to get the new last node. Is there an algorithm to find the last node? Do i need to keep track of each of the parent nodes on each node? Thanks. 回答1: Assuming the tree you start with is a full tree, I would see if you can keep track of the height

Get the size of heap and stack per process in Linux

巧了我就是萌 提交于 2020-01-05 05:43:05
问题 I wanted to know the size of heap and stack per process in linux. Is there any way to find it? I found out that sbrk(0) will give me the end of heap. But how can I find the start of heap to get the heap size? Also on stack size is there any way to find the start of stack and current stack pointer address per process through any library calls or system calls? 回答1: On Linux, you can read /proc/[PID]/maps and find [heap] and [stack] entries. But for the GLIBC heap implementations usually used on

Are objects in Objective-C ever created on the stack?

别来无恙 提交于 2020-01-05 03:18:07
问题 As far as I understand, in C++ you can create objects on the stack: SomeClass object = SomeClass(); or on the heap: SomeClass *object = new SomeClass(); In Objective-C you always seem to create objects on the heap, as [SomeClass alloc] returns a pointer to a new instance. Is this correct? Are objects ever allocated on the stack? If so, what would be a good example? Else, why not? 回答1: The short answer is that objects are always allocated on the heap, not on the stack. This isn't quite the

Diagnosing heap fragmentation on Mac OS X?

有些话、适合烂在心里 提交于 2020-01-05 02:27:48
问题 A Core Foundation app I'm writing seems to be consuming way more memory (according to the "Real Mem" count in Activity Monitor) than I am ever actually allocating. I have confirmed my actual allocations are what I expect them to be (about 10MB) via the Live Bytes Allocations view in Instruments, but the "Real Mem" count in Activity Monitor shows > 60MB and apparently growing. I've also confirmed there are no leaks, also using Instruments. My application keeps a large queue of buffers of

!heap failed. Invalid type information for ntdll!_HEAP_ENTRY

旧街凉风 提交于 2020-01-03 11:02:50
问题 I'm trying to dump heap information from full dump memory file sitting on Windows Server 2003 SP2 x86. Dump was created for 32-bit mixed (native/clr) application which was running on Windows Server 2003 SP2 x64 machine. From the following windbg log I understand that loaded ntdll.dll image is incorrect and does not correspond to ntdll.pdb symbols. I have tried to specify the location to ntdll.dll from the target machine but windbg still shows that the module is loaded from the standard

!heap failed. Invalid type information for ntdll!_HEAP_ENTRY

丶灬走出姿态 提交于 2020-01-03 11:02:21
问题 I'm trying to dump heap information from full dump memory file sitting on Windows Server 2003 SP2 x86. Dump was created for 32-bit mixed (native/clr) application which was running on Windows Server 2003 SP2 x64 machine. From the following windbg log I understand that loaded ntdll.dll image is incorrect and does not correspond to ntdll.pdb symbols. I have tried to specify the location to ntdll.dll from the target machine but windbg still shows that the module is loaded from the standard

Identifying if an address belongs to heap or stack or registers

雨燕双飞 提交于 2020-01-03 09:08:12
问题 I have a pointer available with me to a C/C++ variable. Is it possible to exactly make out which segment of the memory this variable belongs to ? If yes, how ? Note: I just have the address of this variable, no further information if the variable is local/global etc. 回答1: Find out whether your architecture has pointers to your heap or stack region. Usually there are some stackpointers or framepointers.. Then compare your actual address to those addresses and decide where they belong. 回答2: If