memory-management

When thread in Java is removed from memory? [duplicate]

你。 提交于 2020-06-09 18:18:59
问题 This question already has answers here : Java Thread Garbage collected or not (4 answers) Closed 5 years ago . From the Java API doc: The Java Virtual Machine continues to execute threads until following occurs: All threads that are not daemon threads have died, either by returning from the call to the run method or by throwing an exception that propagates beyond the run method. I hope my assumption is correct that once thread finishes its run() method it becomes eligible for garbage

Custom memory manager works fine in release mode, but not in debug mode

我的未来我决定 提交于 2020-06-01 05:30:10
问题 I'm trying to implement a simple memory manager to experiment with memory pooling mechanism and track memory leaks. I'm using VS2019 and so far my code only runs in release x86 mode. Changing the build configuration to debug or setting target platform to x64, results in an access violation error. Specifically, in debug mode the following line which calculates the available pool size, throws an exception "Unhandled exception thrown: read access violation. p was nullptr." return p->end - p-

What happens when you lose the virtual address of the page directory?

流过昼夜 提交于 2020-06-01 01:40:29
问题 I'm writing a memory manager for my kernel (32 bit x86) In the course of this... I'm facing a bit of a dilemma.... Description of virtual memory map: Identity map of first 4 Mb Virtual address 0xC0000000 mapped to physical address 0x100000 (Also a 4 Mb map) My page directory is at physical address 0x9c000. My page table 1 is at physical address 0x9d000. My page table 2 is at physical addres 0x9e000. (I need only two page tables here :) ... These correspond to the identity map and higher

What happens when you lose the virtual address of the page directory?

限于喜欢 提交于 2020-06-01 01:38:08
问题 I'm writing a memory manager for my kernel (32 bit x86) In the course of this... I'm facing a bit of a dilemma.... Description of virtual memory map: Identity map of first 4 Mb Virtual address 0xC0000000 mapped to physical address 0x100000 (Also a 4 Mb map) My page directory is at physical address 0x9c000. My page table 1 is at physical address 0x9d000. My page table 2 is at physical addres 0x9e000. (I need only two page tables here :) ... These correspond to the identity map and higher

Can an inner level of cache be write back inside an inclusive outer-level cache?

本秂侑毒 提交于 2020-05-29 07:40:07
问题 I have asked a similar question: Can a lower level cache have higher associativity and still hold inclusion? Suppose we have 2-level of cache. (L1 being nearest to CPU (inner / lower-level) and L2 being outside that, nearest to main memory) can L1 cache be write back? My attempt) I think we must have only write through cache and we cannot have write back cache in L1. If a block is replaced in the L1 cache then it has to be written back to L2 and also to main memory in order to hold inclusion.

C++ erasing part of the end of a vector without reallocation

橙三吉。 提交于 2020-05-29 03:30:53
问题 Looking through the C++ vector documents, pop_back() is a function that will not cause a reallocation of the vector's data. However, this only works for removing one member of the vector. I am trying to find a way to erase multiple members from the end of a vector. Originally I thought I would call pop_back() in a small for loop but I was wandering if there was a more convenient function that would do this for me? Edit: The Cplusplus vector erase() reference is not as clear as it should be as

unowned vs. weak. Why we should prefer unowned?

自闭症网瘾萝莉.ら 提交于 2020-05-28 12:44:30
问题 As Apple said in "The Swift Programming Language", it seems we should prefer unowned than weak whenever possible: If the captured reference will never become nil, it should always be captured as an unowned reference, rather than a weak reference. From the "Weak and Unowned References" section on this page I did know the difference between these two. But I am curious about is there any good reason for preferring unowned than weak ? I think the weak is much safer and we can just always write

unowned vs. weak. Why we should prefer unowned?

♀尐吖头ヾ 提交于 2020-05-28 12:44:05
问题 As Apple said in "The Swift Programming Language", it seems we should prefer unowned than weak whenever possible: If the captured reference will never become nil, it should always be captured as an unowned reference, rather than a weak reference. From the "Weak and Unowned References" section on this page I did know the difference between these two. But I am curious about is there any good reason for preferring unowned than weak ? I think the weak is much safer and we can just always write

GC performance in Erlang

拜拜、爱过 提交于 2020-05-26 07:33:10
问题 I've started programming erlang recently and there are a few things I want to understand regarding GC. As far as I understand there is a generational GC for the private heap of each process and a reference counting GC for the global shared heap. What I would like to know is if there is anyway to get: How many number of collection cycles? How many bytes are allocated and deallocated, on a global level or process level? What are the private heaps, and shared heap sizes? And can we define this

GC performance in Erlang

社会主义新天地 提交于 2020-05-26 07:28:44
问题 I've started programming erlang recently and there are a few things I want to understand regarding GC. As far as I understand there is a generational GC for the private heap of each process and a reference counting GC for the global shared heap. What I would like to know is if there is anyway to get: How many number of collection cycles? How many bytes are allocated and deallocated, on a global level or process level? What are the private heaps, and shared heap sizes? And can we define this