Skip to main content

Questions tagged [heap-memory]

The heap is process memory set aside for dynamic allocation.

heap-memory
Filter by
Sorted by
Tagged with
1 vote
1 answer
41 views

What would prevent java garbage collection from cleaning heap?

Two k8s pods running the same image (using Adoptium 17 JRE). Around 9pm, they start getting requests and objects are getting created. On the blue pod, we can see the garbage collection working ...
wolf2600's user avatar
  • 589
0 votes
0 answers
28 views

Getting heap storage with proper alignment in C++ for overaligned type

In some use case, you'll need to allocate storage before creating objects inside this storage. Then in order to create these objects, you may need to use placement new: T *pobj = new(pstorage); yet ...
Oersted's user avatar
  • 1,649
-1 votes
1 answer
50 views

Getting heap storage with proper alignment in C++ for non-overaligned type

In some use case, you'll need to allocate storage before creating objects inside this storage. Then in order to create these objects, you may need to use placement new: T *pobj = new(pstorage); yet ...
Oersted's user avatar
  • 1,649
0 votes
1 answer
41 views

Twostate predicate cannot prove parameter is allocated

Inside of a loop after an array of booleans have been allocated, the invariant allocated(sieve) reports true however, attempting to assert the Preserved predicate on the sieve array after an ...
Hath995's user avatar
  • 1,085
0 votes
0 answers
35 views

Can a kernel memory address indicate its type of allocation?

I'm troubleshooting some Linux kernel code, and it would be nice to know where the memory pointer allocation originated. Question: Are there Linux kernel macros available like ADDR_IS_STACK_ADDR(ptr) ...
KJ7LNW's user avatar
  • 1,781
-6 votes
0 answers
76 views

Static variables in C++ [duplicate]

Where are static variables allocated in C++? On the stack or the heap? Also, I read in 7.9 — The stack and the heap that all memory allocated on the stack is known at compile time. Is it true? Does it ...
Ibrahim Al-Etrebi's user avatar
-2 votes
0 answers
7 views

sir my electon project run but make build in earror occurs javascript heap memory errors

my project is a block coding program frok from open block desktop with a repository size of around 10 GB and makes build not build and error accord javascript heap memory. javascript heap memory ...
jaimin parmar's user avatar
0 votes
1 answer
59 views

LLVM Analyzer Garbage value

I work on a custom container and I manually allocate some heap memory: template<typename element_type> class MyClass{ element_type* m_data = nullptr; std::size_t rows, columns; // assume ...
Goug's user avatar
  • 27
0 votes
1 answer
35 views

How to know heap overflow point?

I'm attempting to write a program that determines all palindrome within a given range. My program calls a function (number of digits) that returns the size of an integer (ie. 400 would be 3 as it has ...
Ratdude's user avatar
  • 67
-2 votes
0 answers
51 views

c++ heap vs stack allocation for append function call [duplicate]

If I have a string in C++: std:string a = std:string("haha"); Does it get allocated on the stack since it's a local variable? Or since it's the std::string type, does it directly go on the ...
hooistheman's user avatar
-1 votes
0 answers
31 views

Getting Out of Memory error message while doing execution

I am doing performance execution and have Gatling project which is combined with these (Intellij+ Maven+ Java). When we start execution after some time let say 20sec getting out of memory error ...
Vishal's user avatar
  • 1
0 votes
0 answers
83 views

What is a proper way to initialize object on stack or on heap?

tl;dr; What is a proper way to initialize object on stack or on heap? I want to make a profiling tool that can track time for iterative purposes and for single measurements - so that I can use same ...
Danilo's user avatar
  • 1,021
1 vote
2 answers
160 views

C free() on Ubuntu VM, a question regarding heap memory

A simple program to allocate and free heap memory: int main(int argc, char **argv) { char *b1, *b2, *b3, *b4, *b_large; b1 = malloc(8); memset(b1, 0xaa, 8); b2= malloc(16); memset(...
rdre8's user avatar
  • 45
2 votes
0 answers
34 views

Build wasm with import memory wasm

I want to write code in rust which I will then compile into wasm so that it uses import memory. In the compiled file the wasm from rust want to see similar code (module (import "host" &...
Danila's user avatar
  • 73
-3 votes
2 answers
63 views

Define/Initialize Vectors on Stack vs Heap [closed]

I declare two vectors in my class header file as follows: struct MYDATA { uint8_t A = 0; uint8_t B = 0; }; std::vector<MYDATA> vector1; std::vector<MYDATA> *vector2 = new std::...
Torisoft's user avatar
2 votes
1 answer
103 views

Why does Go's escape analysis move a variable to the heap even when inlining is applied?

Given this: package main func main() { _ = f() } func f() *int { y := 2 res := y * 2 return &res } If you run: go build -gcflags '-m' To get the escape analysis, it says this: ....
thestephenstanton's user avatar
0 votes
2 answers
45 views

How can I increase the survival cycle of an object moving from young generation to old generation heap space in java

I have a spring boot application development which is processing an memory intensive process for an amount of time which is let than 5 mins. It will create lots of objects created and it will be ...
Karthik K B's user avatar
1 vote
3 answers
90 views

Invalid heap pointer

I'm practicing the implementation of Linked list code. so I write the code: file LinkedList.c #include <stdio.h> #include "function.h" int main(void) { //initialize struct Node ...
user22873067's user avatar
1 vote
1 answer
38 views

Tomcat 9 on Ubuntu - where does the initial Xmx come from?

Installed Tomcat 9.0.89 on ubuntu, with openjdk 11.0.22.. without altering anything, starting up Tomcat I see /usr/lib/jvm/java-... -Xms512M -Xmx1024M -server ... Where does those -Xms/x come from? ...
spinemelter's user avatar
1 vote
0 answers
55 views

How to Remove an Instance from Heap Memory in Flutter Dart?

I'm working on a Flutter project and I'm trying to understand how to properly manage memory. Specifically, I want to know how I can remove an instance from heap memory in Dart. I understand that Dart ...
Tejaswini Dev's user avatar
0 votes
0 answers
24 views

Finding where these instances used which consuming more memory

I'm debugging/analyzing Springboot application using VisualVm and Eclipse Memory analyzer tools to find out where heap memory used more. After that plan is to see how can we avoid such instances to ...
Karkala Srikanth's user avatar
2 votes
1 answer
47 views

large number of heap allocations in database query results

I am implementing the Rows interface in sql/driver. When implementing the Next(dest []Value) error method, I found that when the result of data is very large, heap allocation will become a performance ...
xf tan's user avatar
  • 23
2 votes
1 answer
84 views

Does redim use the heap or the stack memory in VBA?

I know this is quite strange to ask for a language that is far from a low-level language such as C and C++, but it caught my attention that for example if I do this: Dim tempArray(0 To 2) As Integer ...
Isaias's user avatar
  • 63
1 vote
1 answer
62 views

String.Intern result inconsistency and possible use cases

string s1 = new string (new char[] { 'H', 'e', 'l', 'l', 'o' }); string i1 = string.Intern(s1); bool result1 = ReferenceEquals(s1, i1); string s2 = new string(new char[] { 'H',...
Furkan Bilal's user avatar
0 votes
0 answers
31 views

Why DirectByteBuffer keeps data on JVM heap instead of native memory in Android?

I wanted use ByteBuffer.allocateDirect to keep data on native memory but it looks like it keeps data on heap. I used this code to check that DirectByteBuffer keeps data on heap. import android.util....
Денис Рязанцев's user avatar
-1 votes
2 answers
88 views

Returning a pointer on the heap and the consequential behaviour [duplicate]

Imagine I have the below scenario: Now if I allocate a pointer inside a function on the heap, and return this pointer back to the main program, is the memory still on the heap, and do I have to free ...
ArthurShelby's user avatar
2 votes
1 answer
86 views

How to make JVM only use large heap size when necessary

I have a Java application running in a container (eclipse-temurin:21-jre-alpine) in a Kubernetes cluster, and I'm trying to optimize its memory usage. The required heap size is very spiky. By default, ...
Cornelius Roemer's user avatar
-3 votes
1 answer
76 views

How is Numpy able to get an array size at run-time?

In C++ the size of an array must be determined at the compile-time. I want to write a simple code in C++, say, to do a naive matrix multiplication with itself (for a matrix that is square in size) and ...
MOON's user avatar
  • 2,732
0 votes
2 answers
85 views

ConcurrentHashMap$Node accumulate in heap without clean by GC

I am using ConcurrentHashMap to cache some short-lived data. That is, there are not many entries in the cache, but insertion and deletion often occur. The problem is that when working under load, GC ...
Mister1Burger's user avatar
0 votes
0 answers
13 views

UniVocity is not releasing memory

I need to compare 2 huge csv file contents based on certain preprocessing... i have done with my logic but process takes much time for huge files so i used univocity Parser it performs faster but it ...
Anitha's user avatar
  • 1
0 votes
1 answer
104 views

"A breakpoint instruction (__debugbreak() statement or a similar call) was executed" without breakpoint :(

Member.h pragma once #ifndef MEMBER_H #define MEMBER_H #include <iostream> #include <string> using namespace std; class Member { private: char* m_id; char* m_pwd; char* ...
 Mei's user avatar
  • 1
1 vote
0 answers
34 views

Out of Heap Memory Error when Generating Multiple PDFs using Itext7 library in Java

I have a Java method that generates PDFs from HTML templates using the iText 7 library. The method works fine for generating a small number of PDFs, but when I try to run this code with 10 threads and ...
Tausif Presolv 360's user avatar
1 vote
1 answer
25 views

Is it possible to determine whether and address was obtained using sbrk or mmap?

I am developing a heap memory allocator based on Hoard for educational purposes. I know how to allocate memory using sbrk and mmap and have developed toy level allocators before. I want to use mmap ...
Borisav Živanović's user avatar
1 vote
0 answers
35 views

When trying to get interface name using Linux call if_indextoname, returned pointer is crashing

While trying to get interface name using below code, returned pointer p is crashing. Can someone help? #include <net/if.h> char *p = NULL, buf[IFNAMSIZ]='\0'; int i = 0; for(i=0; i<50; i++) {...
Ganesan Sudalai's user avatar
0 votes
1 answer
77 views

Size of a Kotlin class that contains custom objects as it's data members

I understand that in Kotlin(or Java) an object is a referenced type. i.e. private var Object1: Obj1? = Obj1() Here var Object1 is a reference(8 bytes) to the instance of class Obj1(on Heap). Thus, If ...
Jatin guglani's user avatar
0 votes
0 answers
25 views

What is "i" in chrome memory heap snapshot?

I am doing a memory analysis for my application. And this i is taking a lot of space. It is storing many objects with same properties from application.
khadeeja's user avatar
  • 165
1 vote
0 answers
64 views

unknown memory leak in Qt6 C++

I installed deleaker and decided to test it on a small code, as a result, I got 1 error about a memory leak, which, as for me, should not be and I do not understand where it comes from ...
zxctatar's user avatar
0 votes
2 answers
78 views

Correct syntax to access array elements in structs?

First-year comp sci student, and first time posting on here. I have a struct: struct Student{ string name; int studentID; int numTests; int *testScores = new int [TESTS]; //Access with ...
Noah Stromberg's user avatar
0 votes
0 answers
42 views

How to detect when a handle to my process is opened with OpenProcess from a foreign process? [duplicate]

I have this code to get all handle of some process by PID using NtQuerySystemInformation() #ifndef UNICODE #define UNICODE #endif #include <windows.h> #include <stdio.h> #include <...
sts's user avatar
  • 11
0 votes
0 answers
21 views

why is RSS 5x the size of heap Total, Array buffer and External combined?

i would like to monitor my applications memory usage. most of the APM tools provide insights to heap usage. which according to my understanding is normal in my case.memory allocation i want to know ...
sohaib's user avatar
  • 1
0 votes
1 answer
60 views

Stack size in relation to virtual memory

In our Operating Systems class we mentioned virtual memory as a mechanism that abstracts physical memory to a process, and that it looks something like this (per process): The stack grows down the ...
lukascobbler's user avatar
0 votes
1 answer
102 views

"java.lang.OutOfMemoryError: Java heap space" with big bidimensional arrays

I made a small program for splitting big files into smaller ones with Java. The code is the following: import java.io.*; public class Main { final static int DIM = 6; final static int GB = ...
Enrypase's user avatar
0 votes
2 answers
101 views

Does Stack being limited in size mean i can only get limited pointers to objects in heap?

if stack size is 1MB, does that mean i can only get less than 1000000/8 pointers to allocate ints in heap? (considering 1MB free stack) yeah i know you might not want to make that many individual ints ...
Nemexia's user avatar
  • 139
0 votes
0 answers
222 views

Angular project increases memory usage after every refresh

I have a problem in my Angular website and I am not sure what is the cause. Every time I refresh the page the memory usage increases by 100-150 mb of ram. I have already tried most of the recommended ...
PTsag's user avatar
  • 126
0 votes
1 answer
198 views

Reached heap limit Allocation failed - Javascript heap out of memory, even though my laptop has 32GB RAM

I just bought a new device for better work performance, and tried to run my project on it. It is an angular project that uses angular 11, and in my old laptop normally I have to set max old space size ...
syl's user avatar
  • 21
-3 votes
2 answers
120 views

Why is there no time cost to large stack allocations

I tried this quick-bench test and I'm finding that it's the same cost timewise to allocate 200 bytes as it is to allocate 2000000 bytes. How could that possibly be?
bobobobo's user avatar
  • 66.6k
1 vote
0 answers
31 views

How does one free memory in the heap in risc-v assembly? [duplicate]

I am currently studying risc-v assembly and started to research more about the heap. In the current problem I'm solving, I'm creating a linked list by allocating space on the heap with a syscall and ...
Andrey Cortez's user avatar
0 votes
0 answers
12 views

How to assign the stack/heap area into the external ram

How could I assign the stack/heap area into the external RAM on the KEIL SDK. My scatter file is like the following. LR_IROM1 0x01008000 0x00400000 { ; load region size_region ER_IROM1 ...
andy's user avatar
  • 117
0 votes
1 answer
19 views

How to copy a CVariable to the heap in Kotlin/Native

I have a CVariable that was created inside of memScoped { } which means that when I return something from memScoped { }, the memory would be freed which means that I'd run into a use-after-free which ...
xdevs23's user avatar
  • 3,964
1 vote
0 answers
51 views

Wipe memory after garbage collector execution in Android

I have some sensitive information in an app that I want to keep in memory for as little time as possible. One of them is, for example, the refresh token. When refreshing the tokens, I get a new ...
Dardo Gonzalez's user avatar

1
2 3 4 5
133