garbage-collection

What is clr.dll on .Net framework and what does it do?

僤鯓⒐⒋嵵緔 提交于 2021-02-18 08:59:50
问题 I use profiling tools on VS2012 and see,that clr.dll works a lot of time. Is it Garbage Collection? What clr.dll can do? Please tell me. Thank you! 回答1: Common Language Runtime. It's basically the engine for .NET 回答2: clr.dll is the primary binary in the .NET runtime version 4.0 and forward. This dll used to be mscorwks.dll in previous versions of .NET. 来源: https://stackoverflow.com/questions/19698819/what-is-clr-dll-on-net-framework-and-what-does-it-do

What is clr.dll on .Net framework and what does it do?

别等时光非礼了梦想. 提交于 2021-02-18 08:59:13
问题 I use profiling tools on VS2012 and see,that clr.dll works a lot of time. Is it Garbage Collection? What clr.dll can do? Please tell me. Thank you! 回答1: Common Language Runtime. It's basically the engine for .NET 回答2: clr.dll is the primary binary in the .NET runtime version 4.0 and forward. This dll used to be mscorwks.dll in previous versions of .NET. 来源: https://stackoverflow.com/questions/19698819/what-is-clr-dll-on-net-framework-and-what-does-it-do

Scala: Mutable vs. Immutable Object Performance - OutOfMemoryError

故事扮演 提交于 2021-02-17 21:23:07
问题 I wanted to compare the performance characteristics of immutable.Map and mutable.Map in Scala for a similar operation (namely, merging many maps into a single one. See this question). I have what appear to be similar implementations for both mutable and immutable maps (see below). As a test, I generated a List containing 1,000,000 single-item Map[Int, Int] and passed this list into the functions I was testing. With sufficient memory, the results were unsurprising: ~1200ms for mutable.Map,

When to choose SerialGC, ParallelGC over CMS, G1 in Java?

偶尔善良 提交于 2021-02-17 08:44:49
问题 In Java 9, G1 GC is the default Garbage collector. As of now, I heard of some people preferring CMS garbage collector over G1GC as it seems to be not stable and has some nasty bugs. What happened with ParallelGC (no buzz these days) ? Is there any use case in which we would like to prefer ParallelGC over CMS/G1 ? Also, is there any case where SerialGC could out perform all these parallel collectors ? 回答1: Serial collector Mainly for single-cpu machine. Algorithm: It use a single thread to

When is finalize() invoked during garbage collection?

泄露秘密 提交于 2021-02-16 14:59:41
问题 From : Q11 of https://www.baeldung.com/java-memory-management-interview-questions When an object becomes eligible for GC, the garbage collector has to run the finalize() on it; this method is guaranteed to run only once, thus the collector flags the object as finalized and gives it a rest until the next cycle. I have a few questions to ask: Is that statement correct? Is it during the marking phase, does the garbage collector invoke the finalize() method? Why does it give a rest until the next

Delaying a task in C# - db context disposed

安稳与你 提交于 2021-02-15 04:59:28
问题 I have a situation where I need certain code to execute at a certain time (in my ASP .NET Core project). I know that delaying a task is not a great solution, but this is what I have and I'd like to know how to make it work: async Task MyMethod() { // do something // Create a new thread that waits for the appropriate time TimeSpan time = dbAppointment.ScheduledOn - TimeSpan.FromMinutes(5.0) - DateTime.UtcNow; _ = Task.Delay(time).ContinueWith(async x => await notificationManager.CreateReminder

Full GC in G1 GC

独自空忆成欢 提交于 2021-02-11 06:43:35
问题 Jstat tool gives stats regarding young gc time and full gc time along with other information. As far as I know, Full GC in G1 GC consists of following phases : 1) Concurrent Marking (not Stop the world) 2) Remarking (Stop the world) 3) Reclaimation of empty regions (Stop the world) 4) Reclaimation of partially empty old regions through mixed gc (Happens over the time) Now, I want to know jstat full gc time measures time for which of the phases ? If Phase 1 and 2 are not considered for full gc

Is GC smart enough to remove objects that are referenced but no longer used?

有些话、适合烂在心里 提交于 2021-02-10 23:17:04
问题 Let's say I have an object called "master" which owns 100 objects called "slave0" through "slave99" respectively. (This is not an array. I have 100 fields in my "master" class called salve0 to slave99 respectively.) Now, let's say my program first reads in a file which contained the serialized stored version of a "master" object.But, let's say my program never uses objects slave50 through slave99. What will happen? (My guess is that the java program will first read all 100 slave objects as

Is GC smart enough to remove objects that are referenced but no longer used?

元气小坏坏 提交于 2021-02-10 23:17:01
问题 Let's say I have an object called "master" which owns 100 objects called "slave0" through "slave99" respectively. (This is not an array. I have 100 fields in my "master" class called salve0 to slave99 respectively.) Now, let's say my program first reads in a file which contained the serialized stored version of a "master" object.But, let's say my program never uses objects slave50 through slave99. What will happen? (My guess is that the java program will first read all 100 slave objects as

Understanding garbage collection in Java for objects managed by container

和自甴很熟 提交于 2021-02-09 02:54:53
问题 Lets say I have a managed bean called A that is @RequestScoped Let's say A has a reference to another managed bean B and B is declared to be @SessionScoped . Will the fact that A has a reference to another bean with longer scope prevent A from getting garbage collected at the end of the HttpRequest ? Will the situation change the other way around ie if B contains a reference to A ? if yes then why ? 回答1: Will the fact that A has a reference to another bean with longer scope prevent A from