442 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
2
votes
1
answer
104
views
Calling a function that returns a vector by value in place and iterating over elements causes first value to be garbage
I have been trying to integrate boost geometry into a project but run into an issue when I return a polygon geometry from my custom class. The following is a minimal example that reproduces what I am ...
-1
votes
0
answers
84
views
Is it always true that uninitialized section of partially initialized array is initialized to 0? [duplicate]
Does the C standard guarantee that any uninitialized portions of a partially initialized array are automatically set to zero? While it's a common observation and often the behavior seen in practice, ...
0
votes
1
answer
106
views
Identifying and Fixing Memory Leaks with Python's gc Module
I have a complex Python application where I'm experiencing memory leaks over time. I'm using a lot of objects with circular references, but I've ensured that del methods are not causing issues. How ...
0
votes
1
answer
96
views
An inclusion of a null pointer is making content of another pointer to have a value (most probably garbage)
I am currently learning pointers in c. I have learned that if I do not assign an address to a pointer and try to print the value of the content of the pointer, then the program will not run properly.
#...
2
votes
0
answers
78
views
Reusable/No-GC implementation of CompletableFuture?
I am working on a Java project that involves async tasks, but where performance is important. This is why not producing garbage is essential. CompletableFutures are practical, but their use inherently ...
-3
votes
1
answer
258
views
new and delete in c++ [duplicate]
im doing an exercise and I cant understand if i'm creating garbage with this program.
As far as I understand there shouldn't be any garbage left and I should not use delete in this case, but it makes ...
1
vote
0
answers
89
views
Find contributors to garbage in Java 21 or what replaces -XX:+PrintClassHistogram(Before|After)FullGC
With Java 8 I occasionally used both, -XX:+PrintClassHistogramBeforeFullGC and -XX:+PrintClassHistogramAfterFullGC to get an impression about which classes contribute most to the garbage to be ...
-1
votes
1
answer
73
views
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 ...
-2
votes
4
answers
118
views
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<stdio.h>
#include<string.h>
typedef ...
0
votes
1
answer
66
views
Why does tkinter add in more quotes than what is in the input string?
Let me start by saying that I am very new to Tkinter.
I want to take input typed by a user from a text box and write to a file in Tkinter. I am using the get() method on the box. I have gotten it to ...
-2
votes
2
answers
281
views
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 ...
0
votes
2
answers
118
views
Why is this code outputting random garbage values at the end? [duplicate]
I was solving a problem on codeforces, but I keep running into unwanted garbage values as output. What can I do?
#include <iostream>
#include <string>
#include <conio.h>
#include <...
0
votes
1
answer
58
views
Can't figure out why node pointer was assigned NULL on a lecture example from CS50 (Week 5)
So the following code was presented in the lecture, and I'm struggling to understand why it was necessary to set n->next = null. David (Lecturer) did say it would be important to clean up potential ...
0
votes
2
answers
60
views
Garbage printed with string after strcpy
I am a beginner in C and I am trying to copy a string inside another one. I have the following code:
#include <stdio.h>
#include <string.h>
typedef struct {
float mort_2009, mort_2015,...
0
votes
2
answers
81
views
Strange Random Behavior in a Local Variable of a Function
I'm trying to write a program that finds the distance of an arbitrary amount of tugboats from a main ship and orders them from closest to furthest. This also involves removing tugboats that are deemd ...