What *is* great Ruby memory management? In this 3-part series, we cover how Ruby memory works, common issues and their causes, and solutions—and how a Scout's monitoring tool is the best way to go from great ...to awesome. https://lnkd.in/g-H52aTb
Scout Monitoring’s Post
More Relevant Posts
-
Boost the performance of your Go services by 10-30% without touching a line of code! Profile-Guided Optimization (PGO) uses runtime profiles to enhance your application's latency & efficiency. https://lnkd.in/gb9jmsts
Unlocking Speed
gitar.co
To view or add a comment, sign in
-
Unowned references prevent retain cycles in Swift. They boost runtime performance, but you risk crashing if you get them wrong. How do they work? What exactly is this performance gain? Should we use them at all?
The Case Against [unowned self]
jacobbartlett.substack.com
To view or add a comment, sign in
-
"In this series of blog posts, you will learn how to collect high-level information about a program’s interaction with memory. This process is usually called memory profiling. Memory profiling helps you understand how an application uses memory over time and helps you build the right mental model of a program’s behavior. Here are some questions it can answer: * What is a program’s total memory consumption and how it changes over time? * Where and when does a program make heap allocations? * What are the code places with the largest amount of allocated memory? * How much memory a program accesses every second?" https://lnkd.in/dgFcs9U7
Memory Profiling Part 1. Introduction
easyperf.net
To view or add a comment, sign in
-
Here I share an experience where I'd over-optimized code when writing it, which was a problem. Learn more about the perils of premature optimization: https://lnkd.in/eGsNn3MA
The Perils of Premature Optimization
kenfinnigan.me
To view or add a comment, sign in
-
⚙️ Understanding Go Slices vs. C Dynamic Arrays In Go, slices are a high-level abstraction over arrays, offering more flexibility and ease of use compared to dynamic arrays in C, which require manual memory management. Here's a comparison between Go slices and dynamic arrays in C: 1. Memory Management: - Go Slices: Memory management is automatic. When a slice grows beyond its capacity, Go automatically allocates a larger underlying array and moves data to it. Developers don't need to worry about allocating or freeing memory. - C Dynamic Arrays: You must manually manage memory using functions like `malloc()` and `realloc()`. If you don’t manage it correctly, this can lead to memory leaks or crashes due to improper allocation or deallocation. 2. Ease of Use: - Go Slices: Slices come with built-in functions such as `append()`, which seamlessly expands the slice. You also have `len()` and `cap()` to get the length and capacity, making operations straightforward. - C Dynamic Arrays: You have to manually resize arrays with `realloc()`. Keeping track of the current size and capacity is also up to the developer, which adds complexity and can lead to errors. 3. Safety - Go Slices: Go has runtime bounds checking, which prevents out-of-bounds access, improving safety and reducing potential bugs. - C Dynamic Arrays: Accessing memory outside the bounds of the array can lead to undefined behavior, and the compiler or runtime does not enforce bounds checking. 4. Performance: - Go Slices: While Go abstracts away manual memory management, slices are still efficient. However, when slices grow, the internal resizing can cause temporary performance hits. - C Dynamic Arrays: Dynamic arrays in C can be more performant in certain low-level cases since they give developers full control over memory allocation. However, this requires more effort to optimize. Conclusion: Go slices provide a simpler, safer, and more user-friendly way to handle dynamic collections of data, automating much of the complexity involved in resizing and memory management. On the other hand, C’s dynamic arrays offer more control but at the cost of increased complexity and risk of errors.
To view or add a comment, sign in
-
So , not to bug you , but my 2 cents again. So in trying to understand how memory allocation and deallocation works in certain technologies, I got my hands soiled in rust. So rust does something interesting with Strings - and other data types that are stored on the heap. So in most languages I know , strings are references - they point to somewhere in memory. What happens when you've got two variables pointing to the same location and they are ready to clear their memory after they go out of scope¿ Do they clear the same memory¿ This will cause memory issues.. What rust does is , rust is like " look s1, I know you were first to point to this location, but s2 wants to help you do that so you know what s1, you can go home. Let s2 handle it ". So at any point in time , only one item is pointing to somewhere in memory( usually the heap ). This helps memory management a great deal. Please note: this is spoken in reference to values stored on the heap . Memory management in stacks are fairly straightforward.. my 2 cents; might not be the most accurate 2 cents..
To view or add a comment, sign in
-
"Profile-guided optimization (PGO) is a compiler feature that uses runtime profiling data to optimize code. Now fully integrated in Go 1.21+, PGO is a powerful tool to boost application performance — and with Grafana Pyroscope, our open source continuous profiling database, you can significantly magnify the value of PGO. In this post, we’ll explore what PGO is, how the Pyroscope team has used it internally to improve performance, and how you can use PGO to make your own programs faster." https://lnkd.in/ekYSTNwG
How to use PGO and Grafana Pyroscope to optimize Go applications | Grafana Labs
grafana.com
To view or add a comment, sign in
-
Did you know some Go programs can end up with memory leaks even when garbage collection is working? Learn how you can avoid common pitfalls that lead to Go memory leaks, and how to identify, investigate, and resolve memory issues in your Go applications: dtdg.co/go-memory-leaks Datadog #monitoring #observability
How to spot and fix memory leaks in Go
datadoghq.com
To view or add a comment, sign in
-
Did you know some Go programs can end up with memory leaks even when garbage collection is working? Learn how you can avoid common pitfalls that lead to Go memory leaks, and how to identify, investigate, and resolve memory issues in your Go applications: dtdg.co/go-memory-leaks Datadog #monitoring #observability
How to spot and fix memory leaks in Go
datadoghq.com
To view or add a comment, sign in
-
Stack vs Heap Memory ◾ Stack Memory 📚: Stack memory is used for static memory allocation. It is a region of memory where function call frames are stored, including local variables and function parameters. Use stack memory for small, short-lived variables such as function parameters, local variables, and for managing function calls. ◾ Heap Memory 🏗️: Heap memory is used for dynamic memory allocation. This means that variables or objects are allocated space in the heap at runtime using operators like new and deallocated using delete. The heap allows for flexible memory allocation and is necessary when the size and lifetime of variables are not known at compile-time. Use heap memory for large data structures or objects that need to persist beyond the scope of a single function, such as dynamically sized arrays, linked lists, or objects that require a flexible lifetime. 🔷 Key Differences: Allocation/Deallocation: ◾ Stack: Automatic and efficient. Managed by the compiler. ◾ Heap: Manual and flexible. Managed by the programmer using new and delete. Speed: ◾ Stack: Faster due to automatic memory management. ◾ Heap: Slower due to manual memory management and possible fragmentation. Lifetime: ◾Stack: Limited to the scope of a function. ◾ Heap: Can persist for the entire program’s execution or until explicitly deleted. Size: ◾ Stack: Limited by stack size (usually smaller, defined by the system). ◾ Heap: Limited by the total memory available in the system (usually larger).
To view or add a comment, sign in
1,916 followers