garbage-collection

Is it true that - Garbage Collector won't collection the object of struct type

社会主义新天地 提交于 2020-02-25 07:29:05
问题 Yesterday, we had a discussion on Gargbage collection. It was discussed that the objects created using Classes are collected by Garbage collector, but it cannot be collected by GC if it is being created using struct I know that structures uses stack and classes uses heap. But, I guess GC never collects unmanaged codes only. So does that mean that the Structure types are unmanaged code. (I don't think so). OR is it that the GC take care of Heap only and not Stack? If yes, then what about int

Why does GC stat minor_gc_count decrement?

我们两清 提交于 2020-02-23 10:16:08
问题 We have an heroku app. When I check GC.stat in the morning, GC.stat[:minor_gc_count] is 51. Later in the day it is 50. From my understanding, this should be the number of times the garbage collector has done a minor sweep, so going up the next morning would make sense, but why would it decrease? 510 talos-intelligence :>heroku run rails c --remote production Running rails c on ⬢ talosintelligence... up, run.2287 (Standard-1X) Loading production environment (Rails 5.2.2.1) irb(main):001:0> GC

What is the best way for debug output for the lua garbage collector?

旧巷老猫 提交于 2020-02-20 11:24:35
问题 I need a game state object in lua(not c++ or tied to C++) to manage lights, cameras, objects, events from my C++ engine (the lua objects are seperate entities from c++, pretty much just standard lua tables). I am concerned about how the GC is going to act in removing these objects since they are going to be created and removed on the fly. what is the best way to turn on Output for the GC? I have the lua source embedded in my code... 回答1: The Lua garbage collector doesn't have any output. You

What is the best way for debug output for the lua garbage collector?

大城市里の小女人 提交于 2020-02-20 11:24:30
问题 I need a game state object in lua(not c++ or tied to C++) to manage lights, cameras, objects, events from my C++ engine (the lua objects are seperate entities from c++, pretty much just standard lua tables). I am concerned about how the GC is going to act in removing these objects since they are going to be created and removed on the fly. what is the best way to turn on Output for the GC? I have the lua source embedded in my code... 回答1: The Lua garbage collector doesn't have any output. You

Why don't purely functional languages use reference counting?

北战南征 提交于 2020-02-17 07:01:33
问题 In purely functional languages, data is immutable. With reference counting, creating a reference cycle requires changing already created data. It seems like purely functional languages could use reference counting without worrying about the possibility of cycles. Am is right? If so, why don't they? I understand that reference counting is slower than GC in many cases, but at least it reduces pause times. It would be nice to have the option to use reference counting in cases where pause times

Why don't purely functional languages use reference counting?

百般思念 提交于 2020-02-17 06:56:55
问题 In purely functional languages, data is immutable. With reference counting, creating a reference cycle requires changing already created data. It seems like purely functional languages could use reference counting without worrying about the possibility of cycles. Am is right? If so, why don't they? I understand that reference counting is slower than GC in many cases, but at least it reduces pause times. It would be nice to have the option to use reference counting in cases where pause times

What happens to 'object' after local scope?

末鹿安然 提交于 2020-02-07 05:26:29
问题 I am eager to know what happens to a object in .NET when it falls out of scope. Something like this: class A { ClassB myObjectB = new ClassB(); } //what happens to object at this point here? What happens in the memory? Does GC get called when it falls out of scope and loose it reference in the heap? 回答1: What happens in the memory? Does GC get called when it falls out of scope and loose it reference in the heap? No - the GC doesn't get called at this point. What happens is that the object is

local variables in an event Handling method and garbage collection

主宰稳场 提交于 2020-02-05 04:12:27
问题 I'm new to c# programming so bear with me, there is a concept I couldn't understand in the event handling pattern, here a simple implementation to an event handling class test { someobject.Click += OnClick; private void OnClick(object sender,EventArgs e) { SomeClass someclass = new SomeClass(); } } the problem is why the variable someclass doesn't get garbage collected since it's a local variable in the method OnClick and gets out of scope when this method finishes 回答1: It does get released,

What are good Java coding practices to help Java GC? [duplicate]

♀尐吖头ヾ 提交于 2020-02-04 04:09:36
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: How can I avoid garbage collection delays in Java games? (Best Practices) Java's GC pause is a killer. Often the time, the application doesn't have the memory leak. At some point, it may pause for ~1 second for every 1G memory allocation. What are good Java coding practices to help Java GC? One example, since null object becomes eligible for garbage collection, so it is a good idea to explicitly set an object to

What are good Java coding practices to help Java GC? [duplicate]

荒凉一梦 提交于 2020-02-04 04:07:09
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: How can I avoid garbage collection delays in Java games? (Best Practices) Java's GC pause is a killer. Often the time, the application doesn't have the memory leak. At some point, it may pause for ~1 second for every 1G memory allocation. What are good Java coding practices to help Java GC? One example, since null object becomes eligible for garbage collection, so it is a good idea to explicitly set an object to