finalizer

remove kubernetes service-catalog finalizer with cli

牧云@^-^@ 提交于 2021-02-10 06:55:15
问题 I'm trying to provision/deprovision service instance/binding from my cloud provider (IBM cloud private), Currently, there is a bug that if the service is not deprovisioned in ICP, that leaves me the orphan service instance on my ICP environment which I can't delete even with force option. They provide a workaround solution of: kubectl edit ServiceInstance <service-instance-name> kubectl edit ServiceBinding <service-binding-name> then delete the line: ... finalizers: - kubernetes-incubator

Ruby forcing garbage collection not working as expected

空扰寡人 提交于 2021-02-08 01:42:09
问题 In the following code: class ExampleClass def initialize ObjectSpace.define_finalizer(self, proc{puts 'dead'}) end end ex = ExampleClass.new ex = nil GC.start while true # the while loop is to prevent the program from terminate # if the program does terminate, the finalizer gets called in the end like expected end The finalizer here is never called and there is no output. I would have expected the garbage collector to collect ex since it has been dereferenced. Why is GC.start not forcing ex

C# Why dispose when we already have finalizers [duplicate]

半腔热情 提交于 2020-07-09 02:59:21
问题 This question already has answers here : Finalize vs Dispose (15 answers) Closed 6 years ago . I've been hearing advices about putting codes to handle unmanaged resources in both finalizer and Dispose() method. What I don't understand is that since finalizers are called when GC occurs so we could technically assume that it gets called all the time. In that case why bother disposing an object? Am I missing something? 回答1: In that case why bother disposing an object? Because you don't have

C# Why dispose when we already have finalizers [duplicate]

老子叫甜甜 提交于 2020-07-09 02:59:05
问题 This question already has answers here : Finalize vs Dispose (15 answers) Closed 6 years ago . I've been hearing advices about putting codes to handle unmanaged resources in both finalizer and Dispose() method. What I don't understand is that since finalizers are called when GC occurs so we could technically assume that it gets called all the time. In that case why bother disposing an object? Am I missing something? 回答1: In that case why bother disposing an object? Because you don't have

Why are there finalizers in java and c#?

谁说胖子不能爱 提交于 2020-06-10 09:19:31
问题 I'm not quite understanding why there are finalizers in languages such as java and c#. AFAIK, they: are not guaranteed to run (in java) if they do run, they may run an arbitrary amount of time after the object in question becomes a candidate for finalization and (at least in java), they incur an amazingly huge performance hit to even stick on a class. So why were they added at all? I asked a friend, and he mumbled something about "you want to have every possible chance to clean up things like

Can a finalizer be called on an object that is in the middle of a (native) call?

混江龙づ霸主 提交于 2020-02-01 09:17:07
问题 We're seeing a weird AddressSanitizer (clang/C++) "heap-use-after-free" violation that might relate to a finalizer corner case. Let's say, a Java object OBJ has a handle to to a native resource X. A thread that created OBJ before, is now making a call on OBJ.method(), which calls into a (static) native method staticMethod(X), in which X is used. Now, at more or less the same time, we're seeing a thread deleting the native resource X. We strongly assume that this triggered by the finalizer

Can a finalizer be called on an object that is in the middle of a (native) call?

萝らか妹 提交于 2020-02-01 09:16:02
问题 We're seeing a weird AddressSanitizer (clang/C++) "heap-use-after-free" violation that might relate to a finalizer corner case. Let's say, a Java object OBJ has a handle to to a native resource X. A thread that created OBJ before, is now making a call on OBJ.method(), which calls into a (static) native method staticMethod(X), in which X is used. Now, at more or less the same time, we're seeing a thread deleting the native resource X. We strongly assume that this triggered by the finalizer

Error: Do not override object.Finalize. Instead, provide a destructor

一笑奈何 提交于 2020-01-21 16:13:31
问题 Getting the above error in following code. How to rectify it. Thanks. Please look for protected override void Finalize() { Dispose(false); } in the below code. using Microsoft.Win32; using System.Runtime.InteropServices; public class Kiosk : IDisposable { #region "IDisposable" // Implementing IDisposable since it might be possible for // someone to forget to cause the unhook to occur. I didn't really // see any problems with this in testing, but since the SDK says // you should do it, then

Error: Do not override object.Finalize. Instead, provide a destructor

懵懂的女人 提交于 2020-01-21 16:13:09
问题 Getting the above error in following code. How to rectify it. Thanks. Please look for protected override void Finalize() { Dispose(false); } in the below code. using Microsoft.Win32; using System.Runtime.InteropServices; public class Kiosk : IDisposable { #region "IDisposable" // Implementing IDisposable since it might be possible for // someone to forget to cause the unhook to occur. I didn't really // see any problems with this in testing, but since the SDK says // you should do it, then

C++/CLI: preventing garbage collection on managed wrapper of unmanaged resource

只谈情不闲聊 提交于 2020-01-21 06:29:05
问题 I have a C++ unmanaged class NativeDog that needs to be used from C#, so I've create a wrapper class ManagedDog . // unmanaged C++ class class NativeDog { NativeDog(...); // constructor ~NativeDog(); // destructor ... } // C++/CLI wrapper class ref class ManagedDog { NativeDog* innerObject; // unmanaged, but private, won't be seen from C# ManagedDog(...) { innerObject = new NativeDog(...); ... } ~ManagedDog() // destructor (like Dispose() in C#) { // free unmanaged resources if (innerObject)