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
6
votes
3 answers

Calling Constructor with in constructor in same class

I was expecting the output 2, 3 but I'm getting garbage value. Why's that? Here's my code: #include using namespace std; class A { public: int a, b; A() { cout << a << " " << b; } A(int x, int y) { …
Rajesh Sethi
  • 179
  • 2
  • 11
6
votes
1 answer

How to avoid or detect implicit delegate inference in C#?

I am writing a game using C# and have found a number of cases where a function takes a delegate and I have inadvertently passed in a function name instead of creating and caching a delegate to use as the parameter instead. This causes a delegate…
Eric Cosky
  • 554
  • 3
  • 11
5
votes
1 answer

Apache caching javascript assets?

Not so long ago I was having trouble with javascript assets. When I made changes to them they wouldn't take effect and the file would become invalid javascript (firebug throwing errors and warnings). I noticed that my changes weren't appearing and…
joseym
  • 1,332
  • 4
  • 20
  • 34
5
votes
1 answer

Memory leak with PyYAML

I think that I'm having a memory leak when loading an .yml file with the library PyYAML. I've followed the next steps: import yaml d = yaml.load(open(filename, 'r')) The memory used by the process (I've gotten it with top or htop) has grown from…
joanlopez
  • 579
  • 1
  • 6
  • 17
5
votes
1 answer

firefox crash with angular ( Garbage Collector troll? )

----EDIT the question was to long and to hard to understand------ Here is a working exemple : http://codepen.io/anon/pen/Mwapgb WARNING : This will make firefox CRASH ! , if you dare, click around 500 time on any div (i suggest to use a tool to…
ssbb
  • 1,921
  • 2
  • 21
  • 42
5
votes
0 answers

Write/Read packets generating garbage

I have a client on Android that uses the TUN interface exposed by the Android VPNService in order to intercept packages. In that regard I read all incoming packets and write them to the TUN interface. This basically means that I do a write for each…
Simon Langhoff
  • 1,395
  • 3
  • 18
  • 28
5
votes
2 answers

Java 8 streams: can you capture/reuse a value calculated in a filter?

I'm trying to convert an "old way" loop into a streams-based approach. The loop takes one large set of elements and returns a subset that fall within a given radius. The results are sorted by distance, and the results themselves have the…
user3184922
  • 61
  • 1
  • 5
5
votes
1 answer

Getting a value by reflection without garbage

I am writing a system which requires me to fetch the values of properties in an object, preferably using reflection. This project is for the xbox360, which runs on the compact framework and thus has a slow garbage collector - this means it's…
Martin
  • 12,469
  • 13
  • 64
  • 128
5
votes
0 answers

G1 garbage collector tuning

I have an application running on Java 7 update 45 on Hotspot JVM. I am trying to tweak the parameters to work for a low latency application and below are the JVM parameters i set for this run. The timings in the individual steps in GC log (approx…
5
votes
1 answer

How is this chan leaked?

I'm trying to understand the problem outlined on this slide: http://talks.golang.org/2013/bestpractices.slide#27 Copying the code in case the URL dies: func sendMsg(msg, addr string) error { conn, err := net.Dial("tcp", addr) if err != nil…
mattbasta
  • 13,492
  • 9
  • 47
  • 68
5
votes
2 answers

Assign value is garbage or undefined

I have posted screenshot of my error code. heights output please any one can help me?
Romit M.
  • 898
  • 11
  • 28
4
votes
1 answer

when .net garbage collector doesn't compact gc heap?

I run the following code StringBuilder sb = new StringBuilder(); Stack stack = new Stack(); SynchronizationContext sc = new SynchronizationContext(); GC.Collect(); Console.WriteLine("GC. First…
4
votes
1 answer

Java, Hibernate, CascadeTypes and 'garbage collecting' Orphans

What kind of cascade type can I use, and where, to have Hibernate automatically remove the Image when there are no more "Things" referring to it? (so sort of Garbagecollecting in Hibernate, basically) Database: Thing table - Image table, is a many…
4
votes
2 answers

Quick Java garbage collection question

I am writing an alarm app in Android, and I have the following: ArrayList pendingIntents = new ArrayList(); public PendingIntent setAlarm(long time) { ...other code. PendingIntent pi =…
4
votes
1 answer

Why is byte map faster than bit map?

I have read the The Garbage Collection Handbook. It says when doing card table,they use bytemap instead of bitmap, and said it is faster than bitmap, is it due to high speed cache line ? But as what i know ,the cache line normally is 64 bytes, if…
terry
  • 123
  • 7
1
2
3
29 30