Questions tagged [garbage]

Garbage, refers to objects, data, or other regions of the memory of a computer system (or other system resources), which will not be used in any future computation by the system, or by a program running on it.

From a programming point-of-view, garbage is data that has been placed in random access memory space obtained from the operating system that is no longer needed. Freeing the space for reuse is called "garbage collecting".

448 questions
0
votes
5 answers

How to avoid object collection by garbage collector

I have some objects in my code which are not invoked in everyloop,But they are useful in future when some forced termination from loop,unpredictable error etc happens, So how to make sure that this objects are not ever collected by garbage…
klobin
  • 41
  • 1
  • 11
0
votes
2 answers

Pass by reference List Java

List> lists = new ArrayList(); //fileName is a list of files to iterate through and extract data from for (int x=0; x
0
votes
1 answer

K&R Exercise 3-2 garbage characters

I am working through the K&R 2nd Edition and have run into a curious problem with exercise 3-2. For some reason only the \n shows up like it's supposed to and of the two tabs in my original string, one shows up as \ while the other is missing…
Yusif_Nurizade
  • 133
  • 1
  • 12
0
votes
0 answers

fread reading garbage value from stdin

The following is a code for sorting numbers based on quicksort in C. To optimize for speed, scanf() has been replaced by fread(). But on printing the sorted list, all garbage values come out. The exact problem statement is on…
user257330
  • 63
  • 13
0
votes
1 answer

c's fprintf writes garbage to the end of file

I am working on some legacy C program. It is some 20 years old version of C, and some old Unix OS (I am not familiar with the exact versions). Anyway, I need to write an xml file, so I wrote the program here at my Ubuntu machine, and when I started…
0
votes
1 answer

Garbage value in jtable after adding row dynamically

I have JTable which has few columns.In that I have JComboBox. At program start I want them to be empty.I have one JButton on click action of button i have the code to add row dynamically in table. But after adding the row i get garbage value in the…
rachana
  • 3,344
  • 7
  • 30
  • 49
0
votes
1 answer

Message queue in linux

In linux, what should be the output of message queue, when message queue is empty? First I have send 2 message in one message queue then I have received 2 message from message queue. Now again I am trying to receive message from message queue then I…
0
votes
3 answers

ValueType Not Getting Garbage Collected?

public struct LocalTLS : IDisposable { public byte[] bArr; public string str; public LocalTLS(int k) { str = "Labamba"; bArr = new byte[20000]; } public void Dispose() { MessageBox.Show("In…
Dr.sai
  • 285
  • 3
  • 4
0
votes
2 answers

PHP extend garbage collector

i need to extend the garbage collector of php so when it deletes an old session it should also delete some database entries.I have tried using implementation of SessionHandlerInterface but it doesnt work. Where should i add my code? Is it possible…
0
votes
4 answers

c++ classes and garbage data

For my last project this year I am trying to make a Gradebook program in C++. Using classes vs structs, new and delete instead of malloc and free, I am to recreate my previous homework written in C. In my last question someone told me to stop making…
user2816227
  • 173
  • 2
  • 13
0
votes
3 answers

Double memory allocation in C#. Bad?

Lets say I have next class: class MyClass { public string Id {get; set;} public List Data = new List(); } I need to fill some list of MyClass instances in next way; // member private List m_instances = new…
user2706838
  • 1,061
  • 2
  • 13
  • 21
0
votes
1 answer

How to minimise garbage collection in the use of HashMap>

Suppose I have a Map> someMap; whose size() ranges from 1 to 100 (this size() stays the same for the duration of the program, the keys also stay the same!). However, in my program, the values associated with the keys are…
0
votes
1 answer

Java Garbage Collection GcInfo.getDuration() changed unit from milli to microseconds

I am currently dealing with a little annoyance with the Class com.sun.management.GcInfo. I improved our server log by adding a GC Notification Listener. Whenever a Major GC Takes place I log the duration it took (and some other stuff). The…
magicroomy
  • 395
  • 1
  • 6
  • 19
0
votes
1 answer

AS3, recycling starling objects

We are a couple of guys making a game. Game entities' data are stored in nested arrays. The top level array contains arrays, which correspond to one entity each. By entity I mean the game objects' parameters stored in the array and the starling…
0
votes
1 answer

Is "garbage value" random? I'm pretty sure my garbage value was just 1 is it possible?? :o

Okay so I have this program of mine: #include #include int deCode(int x[2][5]) { return x[2][4]; // Heres where the "garbage" comes in. } // calling x[2][4] is non valued function. I can call [0,1][0,1,2,3,4] int…