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
2
votes
1 answer

Excessive minor garbage collection time

We are having a problem with excessive minor GC time in our, at some point of the day, the the GC start increasing his CPU time the used eden space decreases and it keeps that way for a few hours. So,my question is, why could it be that the GC keeps…
dssof
  • 117
  • 6
2
votes
2 answers

By printing "garbage values" in uninitialized data segment (bss) can we map out all values from previous program

I have a weird question, and i am not sure if i will be able to explain it but here we go. While learning C and using it you usually come across the term "trash" or "garbage" value, my first question to that is, is data left over data in that…
Zeus Botko
  • 31
  • 1
  • 4
2
votes
1 answer

is the element indexing out of range from dynamically allocated array valid

I had declared a array as int* arr = new int[10]; Then I filled up the first 10 element and also did arr[10] = 100; arr[11] = 200; When I do cout << arr[10] << '\t' << arr[11]; and the output was 100 200 I wonder why the code is working. Is…
Sudip Ghimire
  • 677
  • 6
  • 15
2
votes
2 answers

how can i change the code so the garbage collector will delete this instance due the program?

In the line i marked with //D, there is a one-time use with the object instance Scanner. but its memory witll stay in the heap as long as the program plays(which is forever). why the garbage collector wont delete this instance object? how can i…
2
votes
2 answers

Why the first block of code results in garbage value, while the second block adds up the values of class members?

I have a class named Person which has a name, 4 variables a, b, c, d and a value t which adds a, b, c, d up. Here is the code that describes my problem: #include using namespace std; class person { public: string name; int…
Andy
  • 23
  • 2
2
votes
2 answers

Optimal get of thousandths of a second String without GA/GC

How do I do a thousandths of a second readout, as a timer, without allocating any garbage? I understand that it's possible to build an array of strings, from 000 to 999 for the 0.999, and get the appropriate string of these for each/any thousandths…
Confused
  • 6,048
  • 6
  • 34
  • 75
2
votes
3 answers

Is it mandatory to assign default value zero to integer array in C?

I am implementing program to count frequency of digits in alphanumeric string, but after spending hours with weird output I am able to find solution that C is setting garbage value to all index values. But surprise for me is that compiler setting…
2
votes
2 answers

when will be G1 ( Garbage Collector) starts running and in which memory area it collect first ? what are the new GC update on java 8?

when will be G1 ( Garbage Collector) starts running and in which memory area it collect first? what is the new GC update on java 8?
B_Ali
  • 74
  • 1
  • 2
  • 10
2
votes
2 answers

Spark driver's RMI library causes Full GC pauses (System.gc())

Our Spark executors logs had these: org.apache.spark.rpc.RpcTimeoutException: Futures timed out after [10 seconds]. This timeout is controlled by spark.executor.heartbeatInterval Figuring out that these are heartbeats from executors to the driver,…
Daniel Nitzan
  • 1,582
  • 3
  • 19
  • 36
2
votes
1 answer

Same code giving different results in Online IDE and local IDE

Below program is used to remove the duplicates from a sorted singly linked list. The code gives garbage values in online IDE. But when I comment the line . delete curr; The program works fine in online IDE itself. Here is the function I wrote.…
Pavithran Ravichandiran
  • 1,711
  • 1
  • 17
  • 20
2
votes
3 answers

malloc puts "garbage" values

how can i prevent or bypass the garbage valus malloc puts in my variable? attached the code and the output! thanks! #include #include "stdlib.h" #include int main() { char* hour_char = "13"; char* day_char = "0"; …
JOSI
  • 63
  • 1
  • 5
2
votes
2 answers

does java Java has manual garbage collection?

Ok today I was in an interview and I have been coding Java for years. The interview said "Java garbage collection is a tricky one I had few friends who had struggled figuring out. How are you doing on that?". Was she trying to trick me? or is my…
2
votes
1 answer

Is an object not GC'd even if it has references to other object?

I thought that an object is eligible for Garbage Collection once it is not referenced by any other thing (object or variable). ref : https://stackoverflow.com/a/13144938 But In Java linked list source code Here not only the author removes any…
Harish Kayarohanam
  • 3,886
  • 4
  • 31
  • 55
2
votes
2 answers

copying char array into another array gives garbage value

I'm making a simple encryption program on the bases of ascii. below is my code and I'm not sure why I'm getting a garbage value at the end while printing the copied string. output results #include #include using namespace…
AQ Hassaan
  • 43
  • 4
2
votes
1 answer

C++ ,Single Inheritance, Garbage Value

#include using namespace std; class Alpha { int a; public: void get_a(int x) { a = x; } int hello() { return a; } }; class Beta : public Alpha { int b, c; public: void get_b(int y) { …