Category "memory-management"

Replacing malloc() with my own implementation

I need a fast malloc() / free() replacement. There's mimalloc vom Microsoft Research which is actually on average the fastest malloc()- / free()-replacement. I'

How to avoid excessive ram consumption using pathos

This is a rough example of how I leverage multiprocessing with pathos: from pathos.multiprocessing import ProcessingPool pool = ProcessingPool(10) results = po

Is InnoDB index constructed in cache or disk?

I'm trying to understand InnoDB indices, but have some confusion. Are InnoDB indices (Clustered and Secondary) constructed only in cache or constructed in disk

Is there a way to Marshal a byte[] into a string without copying in C#?

I am in the process of building a sub-part of a native application, namely a Unity application that runs as a child of a different application written in a comp

Delphi FastMM4 how read MemoryManager_EventLog.txt?

I have added FastMM4 to my project for detect a memory leak program MyProg; uses {$IFDEF DEBUG} FastMM4, {$ENDIF} ...other uses on form close FastM

Can we unit test memory allocation?

I have to test a library that provides its own memory allocation routine: void* allocation_routine(size_t size) throw(); Documentation states that this funct

Rapid stack allocations vs accessing a single heap allocation

I'm having a situation where I have an array T[] which must be copied in an instant and sent over to a function accepting a ReadOnlySpan<T>. I found two s

Why does Javascript `iterator.next()` return an object?

Help! I'm learning to love Javascript after programming in C# for quite a while but I'm stuck learning to love the iterable protocol! Why did Javascript adopt

How can I initialize View Again in SwiftUI?

I’m using SwfitUI in my project and I have a NavigationView and List. I’m clicking cell after open the detail view and click navigation back button.

Memory usage of Python base types (particulary int and float)

This is an example from Python 3.8.0 interpreter (however, it is similar in 3.7.5) >>> import sys >>> sys.getsizeof(int) 416 >>> sys

Can I call linux allocation API functions in C?

I want to allocate physical page frames using alloc_pages() in C. I have tried that in kernel module in it works fine. I want to make the code running in user s

Java garbage collection is performed, but GC notification is not received

I have followed a few examples from various sources, and have the following snippet: private void registerForMemUsageChanges() { List<GarbageCollectorM

Private Data in VMMap is very large on some machines

I'm trying to debug a memory exhaustion issue for my native Win32 CPP app, so far i have found that on some machine when launched, app the memory usage is very

Libwesockets.h: Issue with lws_write: C++ string to C conversion and send

I'm using g++. Code: std::string str = "{\"action\":3,\"data\":{\"account\":\"somehashgoeshear\",\"someint\":0,\"id\":1,\"moreint\":0,\"name\":\"demo\

How to compare 1,000 images using the available memory efficiently

This is a tough problem. I have around 1,000 images stored in my disk, and I want to find images that are similar to each other by comparing them in pairs. So I

Lazy initialisation and retain cycle

While using lazy initialisers, is there a chance of having retain cycles? In a blog post and many other places [unowned self] is seen class Person { var

PostgreSQL out of memory: Linux OOM killer

I am having issues with a large query, that I expect to rely on wrong configs of my postgresql.config. My setup is PostgreSQL 9.6 on Ubuntu 17.10 with 32GB RAM

Do I need to worry about if data is stored in the Stack or Heap in .NET? [duplicate]

I've gotten used to the memory management of C++ and having to consider if data should be stored in the Stack or Heap though coming back to C#

How to limit the memory that is available for PostgreSQL server?

For an academic experiment I need to restrict the total amount of memory that is available for a pgSQL server to compute a given set of queries. I know that I c

Why is stack memory size so limited?

When you allocate memory on the heap, the only limit is free RAM (or virtual memory). It makes Gb of memory. So why is stack size so limited (around 1 Mb)? What