Questions tagged [heap-memory]
The heap is process memory set aside for dynamic allocation.
6,547
questions
0
votes
0
answers
23
views
Eclipse memory analyzer Heap dump analysis
recently I have downloaded some 5/6GB size heap dumps, and with great surprise I've noted with Eclipse Memory Analyzer that the leaks suspects report show me a problem total size of circa 500MB, the ...
-1
votes
1
answer
60
views
Getting java.lang.OutOfMemoryError: Java heap space error when using Async method
I am receiving the below error when I am invoking an async method and using ThreadPoolExecutorService.
@Bean(name = "taskExecutor")
public ThreadPoolTaskExecutor taskExecutor() {
...
0
votes
0
answers
35
views
Execute heap dump in remote Java 8+ JVM without first executing a Garbage Collecting
I am using VisualVM to extract a Heap Dump from a tomcat that is consuming a lot of memory resources. It starts consuming around 1GB but gradually reaches 5-6GB. It has peaks where the CPU is at 100% ...
0
votes
0
answers
24
views
docker: tomcat java heap space Out Of Memory
Tomcat memory settings:
CATALINA_OPTS="${CATALINA_OPTS} -Xms64M -Xmx512M -XX:MaxPermSize=512M"
When running on docker for days, the following error will occur:
java.lang.OutOfMemoryError: ...
0
votes
0
answers
11
views
Limit the number of viewscoped beans saved in session in JSF [duplicate]
I'm using JSF 2.3 with javax.faces.STATE_SAVING_METHOD set on client but viewscoped beans are still saved in session and after page reloading the beans are not garbage collected.
I've read about ...
0
votes
2
answers
95
views
while(true) iteration runs out RAM memory
I am trying to figure out this issue:
I tried to run this two easy codes
int main(void) {
while(1) {
printf("Do nothing\n");
}
return 0;
}
When I execute it my memory RAM ...
4
votes
3
answers
110
views
How can I trace all accesses to a memory block?
I am looking to log all accesses to addresses in a block allocated in heap, pointed by a given pointer. In the following example, it would be monitoring all accesses to 1024 bytes from p.
#define BLK ...
0
votes
0
answers
16
views
Flutter App keep on crashing and increase in memory usage
I have made a game using flutter which have multiple pages for different levels but when I reload or play the next level it keep on increasing the ram usage (each levels has some assets images) is the ...
0
votes
1
answer
44
views
Difference between totalJSHeapSize and usedJSHeapSize
I was going over the JS performance.memory documentation to understand the system load our web application is using.
The API returns the following values, explained in MDN as
jsHeapSizeLimit
The ...
0
votes
0
answers
61
views
Why array which is created in heap is still insertable if its size is 0 in C++? [duplicate]
I know that an array with size 0 will initially allocate memory for an array with zero elements using int* arr = new int[0];.
This creates an array with no memory space, and attempting to access ...
1
vote
1
answer
26
views
JavaScript Closures and Block-Scoped Variables In Loop Memory Management
This question is a few different (I think related) questions, which I give below, but broadly I am trying to understand a code piece from David Flanagan's O'Reilly book on JavaScript that gives an ...
0
votes
1
answer
56
views
Out of range exception thrown when declaring a C++ vector on the free store
I'm working on a problem from Stroustrup's PPP book, Chapter 17 - the Drill.
I keep getting out of range errors thrown and believe I may be accessing the vector m_vec incorrectly when I am ...
2
votes
0
answers
35
views
Unable to increase Java heap memory via IntelliJ
Problem:
I run a WSL AlmaLinux with 15_000M allocated RAM, and launch my Java application via IntelliJ, on a OpenJDK 64-Bit.
I need to increase the max heap memory available to my Java application, ...
0
votes
1
answer
42
views
If Heap is dynamic then why it is placed in between stack and data area
I am currently learning about Operating systems and got struck at this.
If the size of Heap area is dynamic then why it is placed at the bottom of the stack.
If size of the heap increase will the ...
0
votes
0
answers
13
views
Jenkins heap issue
I am getting a below error when running maven build. I dont take the job is taking much memory but it fails with heap error just before archiving the artifacts.
[INFO] Final Memory: 118M/9062M
[INFO] -...
0
votes
0
answers
7
views
Code fails only in Release build. Enabling Page Heap prevents the failure but does not detect any error
Win10 MXVCC++ 2022. Some new code works in debug build but fails -- with a self-detected error, not a crash -- in release. Using gflags, heap checking finds no error in either build. Page Heap also ...
4
votes
1
answer
107
views
Why does Go use less memory for a slice of length 100k, than for an array of length 100k?
Consider the following code where I allocate 4 thousand arrays, each of length 100k:
parentMap := make(map[int][100_000]int)
for i := 0; i < 4000; i++ {
parentMap[i] = [100_000]int{}...
0
votes
0
answers
11
views
Memory Allocation of Instance Variables
When we tell objects are created in heap memory and referenced in stack memory.
The reference to the Objects are in stack but where do the Instance variables lie.
Does each object have a collection on ...
4
votes
1
answer
76
views
Visual Studio 22 - Diagnostic Tools - Memory Usage not showing memory leak
I want to detect a simple memory leak using Visual Studio 22. I am using C++.
#include <iostream>
void leak(const unsigned numBytesToLeak)
{
new char[numBytesToLeak];
}
int main()
{
...
0
votes
1
answer
29
views
JMS Service not pushing XML files to Queue. Stops processing in between and needed to restart the service to push the files further
There is a directory named /var/xyz/aa/clm/data/infiles/SenderJMS/CE/L3/ where number of XML files are stored after a process runs. These files contain data to be pushed to remote server through a JMS ...
0
votes
2
answers
89
views
Is there a function(s) to copy a string into a new space in memory [closed]
If I want to copy the string "Best School" into a new space in memory in C programming, What statement(s) can I use to reserve enough space for it?
I have tried using this:
malloc(strlen(&...
0
votes
1
answer
24
views
How to recompile Android app, adding LeakCanary to the apk?
In the OWASP MASTG, there said that you can test the Memory Corruption Bugs by recompile the application and use it with LeakCanary
Dynamic Analysis
There are various steps to take:
In case of native ...
0
votes
0
answers
19
views
Dotnet-Dump on linux x64: How to export heap?
Im using dotnet dump collect -p 1 on my Asp.Net 7.0.9 api running on AKS using the default image from microsoft and when opening the file on Windbg and trying to !heap -? I get an error "No ...
0
votes
0
answers
20
views
Storm 2.4.0 - Worker Heapsize Issue
Although we have given the following parameters in Storm.yaml, it calculates the assigned total memory by multiplying the number of executors in the topology by onheap(128mb).
`topology.component....
0
votes
0
answers
85
views
What exactly is added to the stack when an object comes into scope in C++? [duplicate]
Question Summarized:
I'm well aware how when you enter a new scope, variables get "added onto the stack" but I guess my question is how exactly are objects represented on the stack on a ...
2
votes
1
answer
79
views
How does Boxing move data from stack to heap?
I am new to Rust and trying to understand how boxing works.
By default objects are allocated in Stack.
In the follwing code the object "s" is allocated in the stack.This means the variables ...
0
votes
2
answers
66
views
Heapdump file generated is very small in size when the pod goes Heap Out of Memory (OOM)
We have a kubernetes pod going out of memory very frequently, but the heapdump file that gets generated during OOM is only 200 MB while Xmx and Xms are defined at 2400 MB. So it looks like GC is able ...
0
votes
1
answer
51
views
NodeJs application experiencing frequent downtime
I've a node js application on 16GB machine and is hosted on PM2. The node version is 16.20 and npm version is 9.8. I've set the --max-old-space-size=13000 in both ecosystem.config.js as well as in ...
2
votes
0
answers
64
views
Heaptrack is giving empty heap dump
During my analysis of the memory for my service , getting this warning and its generating a empty zip file even after my service does many activities and lot of memory allocate/deallocate.
(I' am ...
0
votes
0
answers
56
views
What's a neat way to avoid/manage these heap variables?
I'm developing a server app in QT in which i'm handling multiple clients. For every new incoming connection, i'm allocating three variables which actually keep track of incoming data i.e. buffer, ...
0
votes
1
answer
37
views
Why jvm increase all the time without shrink even if has -XX:MaxHeapFreeRatio jvm argument
from jmap result, we can see, free heap size(up to 90%) exceed MaxHeapFreeRatio(40%), but jvm still not shrink.
this is jvm info:
java.vm.name = OpenJDK 64-Bit Server VM
java.vm.version = 25.352-b1
...
0
votes
1
answer
50
views
Java heap space error when trying to create an NGram model
In part of a larger project I need to create an NGram model using Java which is not optimal nor optional I am using JDK 20 and vs code to run the code. When I try to run the code on vs code I get:
` ...
1
vote
3
answers
104
views
Why do I get heap buffer overflow in leetcode?
I was trying to solve a problem for returning the longest palindrome in a string.
I first copy the string in reverse order, and then try to find the longest substring.
Here is the code I wrote:
char *...
0
votes
0
answers
43
views
Paho MqttClient with QoS=2 - Higher used HeapSpace
I am using the eclipse Paho Mqttv5 client and the mosquitto broker.
When I subscribe with QoS=2(ExactlyOnce) e.g MqttProperties occupy more and more space of the heap.
Even if I stop the publishing ...
1
vote
1
answer
62
views
WSO2 EI Docker container 6.4.0 - Facing java.lang.OutOfMemoryError: GC overhead limit exceeded in ETL process
There is ETL process running in WSO2 EI 6.4.0.
Flow: Task Scheduler --> Proxy Service --> Sequence
Task scheduler will trigger proxy service based on cron expression(eg. 0 45 0/2 ? * * * )
...
0
votes
0
answers
15
views
Android: Should I do more to manage memory or just rely on garbage collection?
I'm still rather green in android development and I'm self-taught so this question may be rather basic. I have an app in the Play Store and I've been getting a number of out of memory errors via the ...
-2
votes
1
answer
66
views
leaks command not detecting memory leaks in C program
I have a C program where I suspect the presence of memory leaks
#include <stdio.h>
#include <stdlib.h>
char *f()
{
return (char *)malloc(10);
}
int main()
{
f();
system("...
1
vote
1
answer
79
views
Annotating Heap-allocated Objects in C
When programming in C, distinguishing between pointers that point to stack memory and those that point to heap memory is of vital importance (e.g. one cannot call free with a reference to stack-...
0
votes
1
answer
68
views
How to fix Confluent Kafka Heap Size problem?
I edited every parameter about the JVM heap size, but as you can see in the last line one of the process has 6GB of heap size, how to downgrade it and what is it for?
cp-kafk+ 1121 3.8 4.1 ...
7
votes
5
answers
230
views
What is a good coding practice for freeing allocated resources at failure/exit points in C?
I'm working on a school project and the teacher asked us to free all resources at program's termination.
I'm struggling to find a way to write more readable and/or less code to manage that, ...
4
votes
3
answers
141
views
In cpp what is the difference between `new int` and `new int[1]`?
I am currently learning C++ and am struggling to understand what the difference is between the following two lines of code:
int* a = new int;
int* b = new int[1];
As far as I understand, both ...
0
votes
2
answers
87
views
While upgrading angular v11 to v12 getting this error JavaScript heap out of memory
Today I ran my script for filesystem indexing to refresh RAID files index and after 4h it crashed with following error:
enter image description here
Server is equipped with 8gb RAM.
Today I ran my ...
0
votes
0
answers
14
views
C++ with SmartHeap on Amazon Linux 2023, SIGSEGV when any exception that suppose to be caught is thrown
C++ application with SmartHeap fail to throw exception on Amazon Linux 2023
stack back trace
(gdb) bt
#0 0x00007ffff7cac95c in __gxx_personality_v0 () from /lib64/libstdc++.so.6
#1 ...
0
votes
0
answers
43
views
How can I read informations on the stack memory?
I have this code that is vulnerable to buffer overflow attack because if the user types an argument less than 16, the program prints more informations then It should.
In this case I define 3 buf (buf, ...
1
vote
2
answers
98
views
a heap-buffer-overflow with my c code when i use recursion to solve leetcode task 22
When i run my c code my solution is
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX_LEN 1000
int isValid(char* curStr) {
char* ptr = curStr;
int ...
0
votes
0
answers
18
views
How can i audit a MEAN project to find memory leak problems?
I have a MEAN project using Angular SSR. A cron is being called and running on the server.ts file but since I added few more lines, it gives me ""FATAL ERROR: Reached heap limit Allocation ...
0
votes
2
answers
56
views
Iframes Memory Leak with JQuery and Sizzle
We have a situation where there are 3 levels of nested iframes. The 3rd iframe initializes few heavy size objects, but this iframe is discarded and rebuilt in the DOM whenever user navigates across ...
3
votes
3
answers
104
views
Memory Leak from LazyMOMProvider
my java program is eating a bit too much memory suddenly, and so i dumped its contents while it was in a high usage state and analysed it in Eclipse Memory Analyzer and i get that LazyMOMProvider ...
1
vote
1
answer
80
views
Pybind memory allocations vs python memory allocations
Quite simple really, are objects created with pybind11 (cpython python3.9) in cpp allocated on the same heap as regular python objects, or do they have theor own seperate heap. here are two ...
0
votes
4
answers
167
views
Difference between Array and ArrayList<> in Java in terms of memory allocation?
I came accross an article which had a question-
Contiguous memory locations are usually used for storing actual values in an array but not in ArrayList. Explain.
https://www.geeksforgeeks.org/java-...