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

v8 (javascript) String::New asserted

I work with v8 (google's javascript engine) recently. When the GC is running, String::New always trigger a assert at ASSERT(state_ != NEAR_DEATH)(global-handles.cc 237line). Does have some suggestion. Here is some of my source snippet: void…
Daniel Chen
  • 103
  • 7
-1
votes
3 answers

What would cause delete to leave garbage values in data fields of my class?

I have a node class that contains 3 node pointers and 2 integers. I allocate all the nodes with new, but when I call delete on them, the integers get set to -17891602 and it's screwing up the rest of my code's boundary checking. What would cause…
-1
votes
2 answers

How ArrayList address still the same after doubling the capacity?

in c# ArrayList is a collection ArrayList a = new ArrayList(); a.Add(4); // capacity = 4 and count = 1 a.Add(4); a.Add(4); a.Add(4); //there the capacity is 4 count=4 so Capacity will be doubled if I add new element //but when I add a new…
-1
votes
1 answer

Why don`t Java containers like HashMap or LinkedList reuse internal Nodes which were deleted when adding new elements?

A class like LinkedList stores objects in instances of an internal class called Node. Each time a new element is added, a new Node is created with the 'new' operator. Why does not it try to reuse Nodes that were previously created for elements which…
-1
votes
1 answer

After returning from function when I printed modified string, It shows me the garbage value

int main() { //CODE printf("Enter the destination string : "); char *dest_string = (char *)malloc(sizeof(char)); int le = 0; while(dest_string[le - 1] != '\n') { dest_string = (char…
leo_7348
  • 1
  • 1
-1
votes
1 answer

How does garbage value cause segmentation fault?

Refer to this answer https://stackoverflow.com/a/1422774/16238824 Whatever the garbage value is, I guess we can overwrite it (in order to assign a value). So how does garbage value cause segmentation fault?
WYZku
  • 3
  • 3
-1
votes
1 answer

In this below C code related to pointers and its output, then why doesn't the value a[1] i.e 20 get stored at consecutive address de9?

In the Below code , each location can hold 32 bit signed data. So, why doesn't the value a1 i.e 20 get stored at consecutive address de9? Array should store the data at consecutive memory location right? I know that the sizeof(int) in this online…
Steve
  • 27
  • 4
-1
votes
1 answer

Why am I getting a garbage value at the end of C malloc?

I'm writing encryption and decryption functions that work as follows: encrypt("string") -> "encryptedString" decrypt("encryptedString") -> "string" However, I'm getting weird results when I run them. In my example, I'm encrypting ab#z,A1BZ in…
-1
votes
1 answer

Why am i getting garbage in for loop using string array, gets and puts?

The puts function doesn't print the 3 strings as i input them. They contain garbage. #include #include int main () { char para[20][3]; int x; for(x=0; x<3; x++) { gets(para[x]); fflush(stdin); …
-1
votes
1 answer

How to remove the garbage value read from the file?

#include #include #include #include #include #define N 50 struct Visitor { char name[20]; int y; char pass[20]; int age; int oku; float…
KeanPin Ng
  • 19
  • 5
-1
votes
4 answers

C- mystery value at the end of array

I am trying to insert an integer at the end of an array. However, a random value(47) shows up at the last position when I am trying to execute the code. 47 doesn't change even if I change the value to be inserted. Output is this. Can anyone tell me…
Arka Mukherjee
  • 2,083
  • 1
  • 13
  • 27
-1
votes
1 answer

How to dispose all objects in an eternal WHILE loop in a console appllication in C#

I have to check database for some scheduled task when it is his time do something. But when it has run (without calling any other function), it occupies my hard drive every 5 min, 70MB. Is this normal? How can I solve this problem? static void…
-1
votes
1 answer

Problems with wchar* and printing it C

I have a problem, sometimes in the end of string I get many ????????? I don't know how to fix this, not to get that garbage. . . USHORT length = (USHORT)d.GetLength(); if (length == 0) { cEncodeJsonUtil->AddElement(dataHeader, L"null",…
Vess
  • 249
  • 1
  • 3
  • 10
-1
votes
4 answers

How is it possible to avoid making garbage in Java?

As I know, Java does not have any method for managing memory, because the whole memory management is done by the built in automatically running garbage collector, which might be a little bit inefficient in some cases. http://www.coralblocks.com/ I…
gyurix
  • 1,106
  • 9
  • 23
-1
votes
2 answers

What are the folders and files that I can Delete it in C# Visual Studio Solution to reduce project Size without causing the project to crash?

there are compiled objects and files which created for debugging these files I think that I can delete it, what is it. the actual problem happen when I trying to submit the solution on the Elearning system, the maximum size allowed was 1MB and the…
Basheer AL-MOMANI
  • 14,473
  • 9
  • 96
  • 92