Talk:Garbage (computer science)

Latest comment: 5 years ago by Soulkeeper in topic "Garbage" as in worthless data in memory

"Garbage" as in worthless data in memory

edit

Another use of "garbage" in computer science refers to "bad" data, or data that has been garbled, as in "the program was reading from uninitialized memory, so it was just getting garbage." The artice Atomic_operation uses this meaning in its link to this page.

I'd like to see this article acknowledge this other use (though "garbage" as in "garbage collection" is much more interesting). MusicScience (talk) 05:22, 8 July 2009 (UTC)Reply

Garbage data is the word for what you describe. Unfortunately, garbage data redirects here, which I think is the problem. Perhaps redirecting to noise (signal processing) would be better, but I'd say garbage data is more the special case of zero signal to noise ratio. Like the signal from a disconnected sensor. No noise is actually required, just that any meaningful part of the signal is unrecoverable.--84.209.119.158 (talk) 00:06, 19 June 2014 (UTC)Reply
Another example is what you get in a serial monitor when the baud rates or other encoding parameters don't match up. Related to Data corruption. I think it deserves a mention in this article. - Soulkeeper (talk) 17:38, 2 May 2018 (UTC)Reply
I added a hatnote. - Soulkeeper (talk) 01:53, 10 May 2019 (UTC)Reply

Mention the fix for the example?

edit

Perhaps the fix for the example should be mentioned? Mainly replace Stack::pop() with:

public Object pop() {
  Object ret=elements[size--];
  elements[size]=null;
  return ret;
}

Which results in objects removed from the stack becoming viable garbage collection targets.

There is the issue of no checking for overflow of the stack, and ideally the stack would dynamically grow; but, fixing these wouldn't improve the issue being demonstrated. 207.172.210.101 (talk) 01:29, 30 September 2017 (UTC)Reply