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
2 answers

Java Garbage collection for ideal object

@Service public class test(){ public Map map= new HashMap<>(); } in a web application using spring i annotated a class with @Service and defined a global variable map and inserting values in it. i assumed map hold inserted…
rockey 123
  • 125
  • 1
  • 2
  • 6
2
votes
1 answer

Java JNA 4.3.0 Creates Insane Amout of Garbage When Looking for Process

JNA is making an insane amount of garbage when I'm trying to find a fake process by name. Here is a screenshot of the allocations (about 100k.sec) Here is the test case (used 4.3.0 SNAPSHOT of JNA) import com.sun.jna.Native; import…
Jonathan Beaudoin
  • 2,158
  • 4
  • 27
  • 63
2
votes
2 answers

If a Java process is killed in Unix(Solaris)/Windows is the memory used released?

We have an application that keeps hanging, and it runs on Java (usually running on a Solaris server). Every time it hangs we have to kill the process. But we can't tell whether Java's garbage collector actually does anything once the process is…
Juancho
  • 21
  • 1
2
votes
4 answers

ESP8266 returning garbage values

I am working on an Arduino-based project. When I send AT commands manually through the serial monitor, I get the correct response, but when I try the same commands through code, the ESP8266 returns garbage values. I've attached both the responses…
2
votes
1 answer

Java outputs garbage?

import java.io.BufferedReader; import java.io.CharArrayReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.lang.reflect.Array; import java.util.ArrayList; import java.util.Arrays; import…
Omar Salem
  • 25
  • 6
2
votes
0 answers

Number of GC call increasing (golang)

I have a webservice written in Golang which is running on an ARMv7 server. After a few hours, the process crashes. I decided to monitor the processus with NewRelic (with this plugin https://github.com/yvasiyarov/gorelic). I can notice that the…
GuillaumeP
  • 504
  • 5
  • 19
2
votes
4 answers

Garbage Created By Object that is Never Referenced

Is any garbage created by an object that is never referenced? The example I am thinking of is using a static factory method to create an object then having that object perform a function but never creating a reference to it. For…
ford prefect
  • 7,096
  • 11
  • 56
  • 83
2
votes
1 answer

Kotlin: Massive amounts of ConsPStack, how can I avoid?

How can I avoid the massive amount of ConsPStack that are created by my application? When are these created? My application: https://github.com/Jire/Abendigo
Jire
  • 9,680
  • 14
  • 52
  • 87
2
votes
2 answers

Array member reference and garbage collection

If a member of an array is kept being referenced, the whole array will not be garbage collected? for example, a method: void ParseUtility(string strInput, out string header) { header = ""; string[] parsed =…
Chengting
  • 345
  • 2
  • 4
  • 11
2
votes
2 answers

Monitoring CPU, RAM, I/O usage at time of Java Garbage Collection

I am using -Xloggc to output the GC messages to a file. However I am also interested in knowing the system parameters like CPU, Memory, I/O when the GC events happen. I understand that sar linux command is there, but how can I know the metrics at…
Novice User
  • 3,552
  • 6
  • 31
  • 56
2
votes
2 answers

Why does "garbage" data appear to not be meaningful?

I have always wondered why garbage data appears to not be meaningful. For clarity, what I mean by "garbage" is data that is just whatever happens to be at a particular memory address, that you have access to because of something like forgetting to…
user3424612
  • 183
  • 1
  • 1
  • 9
2
votes
2 answers

java eliminating garbage generation

Suppose we have java task that is working in isolation and we are able to monitor it using visualvm... and we notice continuous garbage creation and periodic gc like this. How do we detect what exactly is causing this issue is there a way to see…
vach
  • 10,571
  • 12
  • 68
  • 106
2
votes
1 answer

Hold Ruby object from C library, avoid being garbage collected

I have a situation where I need to hold a reference to a Ruby object (instance of VALUE) SOLELY from a C struct; i.e., the Ruby object is created and passed to the C library. Currently, the Ruby object stays valid so long as, somewhere in my Ruby…
mcpierce
  • 312
  • 5
  • 16
2
votes
1 answer

Understanding Android garbage collection

I'm having trouble finding good information about garbage collection in Android. I don't really understand when you have a memory exception Here's a question: When I run my application and monitor it with the Android Device Monitor I see that the…
Joske369
  • 505
  • 1
  • 6
  • 18
2
votes
2 answers

Garbage collection of a fragment in java

This may be a stupid question but i have little knowledge of garbage collection. When i looked up info about it, it became clear that nullifying an object sets it's reference count to 0 so it becomes eligble for garbage collection So i wanted to…
DennisVA
  • 2,068
  • 1
  • 25
  • 35