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

Python RAM usage after closing

My python script does connect to different ssh'es for like 1000 times, per python script run, also fetches web-pages, using requests. What I'm using is subprocess, to execute ssh connection, and requests library, to fetch web-pages. After that, when…
Sergey
  • 1
  • 1
-1
votes
1 answer

Writing a structure to file giving garbage value

Hi I am trying to write a structure to a file. Below is the code. #include #include #include /*structure*/ struct student { char name[10]; char space[1]; char rollno[5]; …
-1
votes
3 answers

Which are the objects are garbage collected?

String strMsg = "PM"; float price = 7.50f; price = 8.50f; strMsg = "AM"; strMsg = "MN"; price = 9.50f;; Also, why are they collected?
-1
votes
1 answer

Teaching myself .net How would Garbage Collection handle this example

So I had a few questions about garbage collection. void send_email() { EmailMessage message = new EmailMessage(service); message.Subject = "AQState"; message.Body = Environment.MachineName + " AQState = " + get_AQState(); …
mac_attack18
  • 49
  • 1
  • 5
-1
votes
5 answers

Can garbage collector run on Static class objects

I have to make class, who's object is never garbage collected . So If I give class as an static does it will avoid garbage collection on his objects,Or is ther any another way to do that ??
klobin
  • 41
  • 1
  • 11
-1
votes
1 answer

Is that a bad practice? Will the garbage collector take care in this case?

In my application, every time when the connect button is pressed a new dialog is created. The dialog may contain different items every time, because the items are collected from the system. That will generate many objects of that type. Is that a bad…
Ted Tedson
  • 316
  • 1
  • 6
  • 15
-1
votes
1 answer

Array has garbage values in function in c++!

I have the following function: int *array1=new int [3]; void My_function() { My_set(array1); for(int i=0;i<3;i++){ //The output is 5 15 55 cout<
-1
votes
1 answer

c# correct memory clearance or whatever

I have some class ByteBitmap which contains inside private field byte[] bytes. The main class Reader has a variable (like a cache) of ByteBitmap. Reader implements IDisposable. My problem is that variable breaks correct work of the Reader during…
Alexander
  • 431
  • 2
  • 5
  • 19
-1
votes
2 answers

Where will be the most chance of the garbage collector being invoked?

i an not able to track where garbage collector being invoked.plz help class Garbage01 { public static void main(String args[]) { Garbage01 h = new Garbage01(); h.methodA(); /* Line 6 */ } Object methodA() { Object obj1 = new…
Sandeep vashisth
  • 1,040
  • 7
  • 20
  • 40
-2
votes
4 answers

Garbage value when swapping array with memcpy()

I am trying to make a generic swap function using memcpy() in C. I am getting a garbage value when I try to swap arrays. This is code below: #include #include typedef struct Student { char a[10]; int b; double c; } …
-2
votes
2 answers

Why is my C# TCP client receiving garbage sometimes?

If the server sends 2 items of data at almost the same time, the client receives the 2nd item of data. It will have about 75% to receive garbage. I'm pretty sure the problem is in the C# client: I've printed the buffer in the server - everything is…
SEU
  • 3
  • 2
-2
votes
2 answers

Binary Semaphore program has extremely unpredictable output

My program uses an enum as a semaphore. There are two possible values/states(Because it's a binary semaphore). The program compiles fine. signal() and wait() look logical. Why is program behavior so unpredictable? Even the integer printf is buggy.…
-2
votes
2 answers

Getting multiple float input using scanf but the input is allocated only to 1st variable

main() { float n1, n2, n3, n4, n5, agg_mrk, prcnt; printf("Enter the marks of five students "); scanf("%f, %f, %f, %f, %f", &n1, &n2, &n3, &n4, &n5); printf("the five number entered by u is %f, %f, %f,%f, %f", n1, n2, n3, n4, n5); …
SD_Coder
  • 15
  • 5
-2
votes
1 answer

Common data structures used in java Garbage Collection techniques

I have come across the following question multiple times: What data structures are used in garbage collection? I haven't found many resources about the data structures used in GC algorithms. Edit: I understand that the question seems too broad…
-2
votes
1 answer

Why is this returning Garbage?

I am making a calculator for a game. I usually first make sure the code is working in C++, and then convert it to the desired language. I had made this program. In this program, some of the times, optDura stores the correct value and other times, it…
dknight
  • 267
  • 2
  • 9
1 2 3
29
30