Questions tagged [finalization]

Finalization is intended for questions regarding programmatically releasing memory in conjuction with garbage collection, external resources and weak references.

References

57 questions
0
votes
3 answers

C++ automatic finalization or objects destruction

In this example I faced the problem of copying the code: void BadExample1() { if (!Initialize1()) return; if (!Initialize2()) { Finalize1(); return; } if (!Initialize3()) { Finalize1(); Finalize2(); return; } …
urbanzz
  • 127
  • 8
0
votes
1 answer

IDisposable, using and GarbageColleciton

I got stuck in the weeds of how IDisposable and the GarbageCollector work. Suppose you have an IDisposable object, which doesn't actually have an resources that it's holding onto (but the Dispose() method is going to do something when called). And…
Brondahl
  • 7,402
  • 5
  • 45
  • 74
0
votes
4 answers

I'm pretty sure finalize is still bad news on later JVMs--is there an alternative?

I would like to implement a ORM-style system that can save updates to POJOs when they are no longer reachable by the caller. I thought the reference classes could do it, but they seem to only enqueue the reference after the object has been cleared…
Bill K
  • 62,186
  • 18
  • 105
  • 157
0
votes
2 answers

GValue initialization/finalization necessity

When should I call g_value_init/g_value_reset? Currently, I'm using g_value_init and g_value_reset in all cases, but I want to know whether it could be sped up. I know at least that: When using objects or boxed types, one definitely needs to call…
Top Sekret
  • 748
  • 5
  • 21
0
votes
1 answer

WPF Application initialization and finalization

I am preparing to write a WPF client application that uses ICE (Internet Communication Engine) middleware. ICE requires proper initialization and finalization. All the examples show how to accomplish this in a usual console application - which is…
kubal5003
  • 7,186
  • 8
  • 52
  • 90
0
votes
0 answers

What does "finalize objects on finalization queue" do?

When I open the Java Console in Java SE 7 Update 76, I'm shown a list of keyboard shortcuts I can use for debugging. The shortcut for F is labeled finalize objects on finalization queue. When I run this shortcut, it prints the following information…
Stevoisiak
  • 23,794
  • 27
  • 122
  • 225
0
votes
2 answers

Memory leak in VB

We noticed one interesting issue regarding memory management in VB that we do not understand. If anyone could help us with this one, please do. We have a simple class with one single event. We create and destroy 5000 instances of this class and…
Gico
  • 1,276
  • 2
  • 15
  • 30
0
votes
0 answers

Compilation error GNU Fortran - finalization

I am trying to compile a large code in using GNU compiler. However, when I try to compile the attached piece of code with GNU Fortran (GCC) 6.1.0, some routines using type fn_grid_nodes_t throw this error message: @bld .. linking, ... Undefined…
gian
  • 1
  • 1
0
votes
1 answer

C++ : Order of finalization of a derived class object

I know the order of finalization of a class object is the following : Execute body of destructor Destroy the object (i.e. deallocate memory used for data members) Now I was asked about the order of finalization for derived class objects. I…
Kevin
  • 2,813
  • 3
  • 20
  • 30
0
votes
2 answers

Will I avoid using Reflection during finalization with PhantomReferences?

Let's say that I created a class MyClass that implements Closable. So in the close() method I am going to free some very important recources. Well since it is very important recources I created some kind of safety network (as recommended in…
Anton Kasianchuk
  • 1,177
  • 5
  • 13
  • 31
0
votes
1 answer

Java Finalization Queue and memory leaks

How to get list of all objects waiting for finalization?, so that I can manually finalize it. Currently I did not get direct method to get all objects waiting for finalization.
-2
votes
1 answer

Finalization and promoting to generation1

my question is, i have objects in the generation 0, and i also overridden the finalization method. When the gc collects the gen0, sees that it has to finalize to, so doesn't releases them immediatly, and promotes these objects to gen1? Therefore…
Franmcod
  • 319
  • 4
  • 12
1 2 3
4