12,218
questions
0
votes
0
answers
27
views
High Memory Usage after migrating from Java 8 to Java 17
Our java Application is deployed in AWS Infra on EC2.
Application running JVM Options - -Xmx51g -Xms24g -Xmn5g. with java 8 during start of the application it was using approx 30g but when migrated to ...
0
votes
1
answer
79
views
Mysterious class field "far" preventing garbage collection
I have a project that contains a class similar to this:
data class Project(val someMemoryHeavyMember: String) {
companion object {
fun readFile(file: File): Project {
TODO(&...
2
votes
1
answer
49
views
Dotnet garbage collector not collection objects when I change reference to null [duplicate]
I wanted to try how garbage collector works in .NET, but results are not clear for me.
public class Test
{
public string Name { get; set; }
~Test()
{
Console.WriteLine("NICE&...
0
votes
1
answer
36
views
Express.js Backend: 'JavaScript Heap Out of Memory' Error - How to find out the actual reason?
I have a microservice that processes orders, built with Express.js, MongoDB, Redis, and RabbitMQ. It's running on an EC2 instance with a 2-core CPU and 8GB RAM.
Initially, I encountered the following ...
-1
votes
0
answers
43
views
Very frequent thread dump messages in GC log
I'm seeing a ton of log messages in our GC logs that look like below:
[2024-08-28T14:59:02.452+0000] Application time: 0.0201235 seconds
[2024-08-28T14:59:02.452+0000] Entering safepoint region: ...
0
votes
0
answers
18
views
How reliable is GCHeapStats_V1 GCHandleCount?
I have seen GCHandleCount from GCHeapStats_V1 report values 3 orders of magnitude above the counts I get from SOS GCHandles command.
I know that GCHandleCount tracks counts "loosely":
...
0
votes
0
answers
53
views
GIT repo size explosion - repo size grows much faster than combined size of commit patch files [duplicate]
I'm noticing that my GIT repository size (aggressively pruned, gc'd, repack'd) is increasing much faster than the combined size of the patch files for the same commits.
The repo:
files: .txt, .py, ....
0
votes
1
answer
29
views
How to be notified of a garbage collection operation?
In a complex .NET application, I have some suspicious timing issues in a critical section of code, and I suspect a garbage collection may be the issue. I would like to log a line when a GC is ...
0
votes
3
answers
47
views
How to Prevent Coroutine Resource Leaks After Object Deletion in Kotlin?
I'm working with coroutines in Kotlin and encountered an issue where jobs continue to run even after the object that started them is set to null. This leads to resource leaks, with coroutines still ...
1
vote
2
answers
84
views
Can the Garbage Collector move a struct during a call?
I'm implementing a stack based vector type like this:
[StructLayout(LayoutKind.Sequential)]
public struct VectorI16x8 {
public short s0, s1, s2, s3, s4, s5, s6, s7;
public ...
0
votes
0
answers
45
views
Calling Garbage Collector after reading & comparing a huge files
Hello with following code:
private void CompareFiles(string localPath, string remotePath, in ConcurrentBag<FileInfo> filesToUpdate, string partPath)
{
var localFiles = new Dictionary<...
0
votes
2
answers
47
views
JS GC in closure
hi i have a query and was unable to get exact answer. I have a below closure function
function closure() {let innerVal; return function() {innerVal = innerVal+10}}
let inst = closure();
inst();
...
1
vote
1
answer
76
views
Is there a way to store managed pointers in a stackalloc buffer without incurring unexpected behavior from the GC? [duplicate]
I'm working with C# in a game engine and frequently need to pass around subsets of collections of objects to different synchronous functions. I need to avoid making heap allocations for each call, and ...
1
vote
0
answers
73
views
Is using inline arrays a good idea?
Suppose I have a class which requires a small buffer of some value type. For example, it requires a buffer of four Int32s. I could declare a reference to an array that would fulfil this requirement, ...
0
votes
0
answers
16
views
Garbage Collection Performance Counters
I'm trying to understand if I am facing an issue with garbage collection in my application and if so, what kind of an issue it is.
I'm seeing that the Gen0 and Gen1 collections are staying on the same ...
0
votes
0
answers
34
views
G1 GC Logs show regions but not detailed byte information
Using Adoptium Temurin Java 11 and G1 GC settings of
-XX:+UseG1GC -XX:+DisableExplicitGC -verbosegc -Xlog:gc*,safepoint=debug:file=${GCFILENAME}:tags,time,uptime,level:filecount=10,filesize=10M -XX:-...
-2
votes
1
answer
55
views
Will the lock be removed if we delete the object which monitor is being used [duplicate]
Let's imagine that we have some kind of public global map which entities' monitors are used in synchronized blocks in different methods of other classes. In some moment we remove entities from our ...
1
vote
2
answers
42
views
How to use an ArrayPool outside of a simple loop scenario
I pull live images from a camera in a tight loop and use them to update a live WPF image on the display. In memory profiling I saw that my simple approach was hammering the large-object pool hard.
...
0
votes
0
answers
41
views
Are there reference cycles or other unreachable objects in Python 3 that cannot be destroyed by the garbage collector?
When the Python garbage collector runs (at a sufficiently high generation) it will find cycles of unreachable objects, meaning that they can't be accessed anymore, but the reference count will never ...
1
vote
1
answer
30
views
Garbage Collection DOTNET_gcServer setting
We have a .net 6.0 server app and the MS docs don't give absolute clarity on how to set up our gen 2 garbage collection so it doesn't suspend all our application threads.
We've put this in our .csproj ...
0
votes
1
answer
36
views
How to check if the object leads to memory leak with autotests?
I have an object, that have internal logic related to events subscription.
I want to write an autotest, that checks if the object can be collected by GC after certain steps.
For example:
public ...
3
votes
1
answer
81
views
Does the use of an iterator imply a heap object?
Does the creation of an object of type IEnumerable<T> (such as the numbers object of type IEnumerable<int> in the below code example) imply the creation of an object on the heap that has ...
0
votes
0
answers
9
views
Mimedata objects are being deleted
I have a short script designed to keep a list of clipboard items for easy access. I am using QMimeData objects referenced by a list. However, the script keeps crashing because Python seems to be ...
0
votes
0
answers
18
views
Python destructors not called in Visual Studio 2017
When I run a python program from VS2017-Pro using the debugger, the destructor is not called automatically when the program exits. If the python program is executed directly from a command prompt, ...
0
votes
1
answer
24
views
PHP: determine session expiration
I have seen many articles on the internet but none of them answers my question. Which is a simple one. I want to solve this:
user starts a form and a PHP session
the user advances a few pages
the ...
0
votes
0
answers
29
views
Can explicitly invoking the garbage collector in Python have side effects in this case?
can anyone help me with this?
When I call the heal_client method, and gc.collect() is executed, it successfully closes my database connection (just what I need). Is there something wrong with this ...
0
votes
0
answers
35
views
.Net Garbage Collection when using Interop.Access
I use the following code to open Access (via Interop.Access dll version 9.0.0.0) and display a report for the user. In looking at Task Manager, when this is executed Access first appears in the ...
1
vote
0
answers
55
views
Why does the concurrent-sweep phase in CMS work well while application threads are running?
I’ve learned about the CMS garbage collector, but I’m having trouble understanding how the concurrent-sweep phase works. If an object is marked as garbage during the remark phase and then later ...
4
votes
0
answers
116
views
How to implementing a garbage collector with the statepoint-example strategy in LLVM?
I’m new to LLVM and I’m trying to implement a garbage collector that uses the statepoint API. I have been reading all the documentation and I think I have an idea of the path ahead of me. However, I ...
1
vote
1
answer
74
views
Why does Python implement cyclic GC on types that reference non-container types
Checking docs:
Supporting Cyclic Garbage Collection
Python’s support for detecting and collecting garbage which involves circular references requires support from object types which are “containers” ...
0
votes
0
answers
38
views
Does this code guarantee that a Python object is deleted immediately?
I am using the Redis asynchronous client with Celery but I have had some problems with the integration between the two. The context is that I need to delete the redis.Redis instance (created in the ...
2
votes
1
answer
91
views
Memory / garbage collector issues with Java Spring service
I have a memory issue with a Java service (21) using the Spring framework (3.2.1).
The service is quite simple. It exposes a REST endpoint.
When this endpoint is called, the service makes an HTTP ...
0
votes
0
answers
28
views
How to Tune GC for applications maintaining large amount of cache data?
We are running Spring boot restapi application in Production. Suddenly process is not accepting any requests and we couldn't see logs also. Process got hung. We are using G1GC .We are maintaining ...
0
votes
0
answers
43
views
tkinter image collecter by garbage collector python
I'm trying to display a PIL image that i converted to tkImage inside a function of my main class representing my application.But i keep having the error corresponding to the suppression of my tkImage ...
0
votes
1
answer
87
views
Parse large xml file with XMLPullParser or Sax-Parser in Android causes lags
I'm having following problem: In my android tv app I can add (and later update) epg-sources, as .xml, .gz or .xz file (.gz and .xz are decompressed to .xml). So the user adds an url for a file, it ...
0
votes
1
answer
58
views
Is it important to call `close()` on an file opened with `open()` if `flush()` is called after each write() operation?
I have read that it is important to call close() on a file which has been opened with open(filename, 'w'|'a') because otherwise changes made to the opened file may not be persisted. I believe this is ...
1
vote
1
answer
85
views
How to Print Humongous Allocations in a Java Program Without Using GC Logs?
I'm currently working on a Java application that makes use of humongous allocations and regions. Typically, I would monitor these allocations and regions using the GC (Garbage Collection) logs. ...
1
vote
1
answer
224
views
OpenJDK Java17 ZGC garbage collector won't use more than 20% of allocated ram [closed]
I have a very high throughput microservice running in AWS in ECS using OpenJDK Java17. I'm testing with ZGC moving from G1GC and I notice that ZGC will not use the full allocated heap (10g), only 20% ...
0
votes
0
answers
90
views
Error: VM option 'UseG1GC' is experimental and must be enabled via -XX:+UnlockExperimentalVMOptions. Error: Could not create the Java Virtual Machine
I install JAVA 8 from Oracle's offcial website on my new mac.
I want to run unit tests for my scala project on my local.
I am able to build the project with mvn clean install -DskipTests successfully.
...
0
votes
0
answers
30
views
System.Windows.Controls.PrintDialog handle not released on cancel
We have a simple method looking like this:
public void DisplayPrintDialog(Document document)
{
try
{
PrintDialog printDialog = new PrintDialog();
if (printDialog.ShowDialog() ?...
2
votes
0
answers
114
views
Should I implement a C# destructor (aka finalizer) to unsubscribe from a system event? [duplicate]
Answer to "duplicate" - while a weak event may be the best solution here. The question is very different.
In this answer we are told to (almost) never write a destructor by someone who ...
-1
votes
2
answers
73
views
Will this code cause a memory leak in Flutter?
Will this code cause a memory leak in Flutter?
Classes A and B reference each other:
The VM in Flutter has GC, which is different from other languages I've learned, such as OC or Swift.
I observed ...
-1
votes
1
answer
78
views
High Memory Usage with large number of object in java
I have the below sample code which loop for 50 Million time and create objects of MyDataHolder . MyDataHolder has two variants one is hashmap based and the other is variable based. see (...
0
votes
0
answers
42
views
Git's built-in garbage collection vs JGit handling of garbage collection operation ( Built-in Git vs JGit garbage collection mechanism)
Here are the few points :
Git's built-in mechanism automatically triggers the git gc when the number of loose objects are high or it detects repository size is huge and objects should be garbage ...
2
votes
1
answer
106
views
Does Boehm GC release memory?
I've been looking at the Boehm GC (for C/C++) and it seems to me that (on Windows, but probably on linux as well) the GC, by default, never releases the memory it has asked for.
Worth to note is that ...
0
votes
1
answer
50
views
rendering text in Unity causes huge garbage collector work and slower productivity (low fps)
i'm writing a visual novel and i've noticed an issue. My script is BIG (has a lot of text i mean) and the more process of game i get the more time i need to wait to render the text. it just appears ...
0
votes
0
answers
88
views
Given OpenJDK's imminent deprecation for removal of sun.misc.Unsafe, is there an alternative to accessing an object's mark word or generation age?
I help maintain a Java immutable collections library. One critical optimization we do is deduplicating internal structures of our collections during equality checks when the internal structures are ...
0
votes
0
answers
45
views
Questions about ParallelGC and Full GC behavior in long-running systems
I have a few concerns about ParallelGC and its behavior in long-running systems:
It seems that only Full GC can reclaim the old generation, implying that the old generation can only grow until a Full ...
0
votes
2
answers
110
views
How do I remove or delete an object inside a function?
I want to make a simple delete function in Python which should remove any reference and delete the object. This can be used to remove unused simulated objects:
import numpy as np
class Unit:
def ...
-1
votes
1
answer
95
views
Deleting current controls in java
OK, let's try this. This a small Java application to dynamically create JButtons. What I am trying to find a way to do is fully delete created JButtons so the garbage collection will free up the ...