惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

雷峰网
雷峰网
T
Threatpost
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
T
Tailwind CSS Blog
IT之家
IT之家
H
Hackread – Cybersecurity News, Data Breaches, AI and More
WordPress大学
WordPress大学
博客园 - 司徒正美
Microsoft Azure Blog
Microsoft Azure Blog
Hugging Face - Blog
Hugging Face - Blog
Google DeepMind News
Google DeepMind News
阮一峰的网络日志
阮一峰的网络日志
博客园 - 三生石上(FineUI控件)
Google Online Security Blog
Google Online Security Blog
The GitHub Blog
The GitHub Blog
Martin Fowler
Martin Fowler
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
有赞技术团队
有赞技术团队
S
SegmentFault 最新的问题
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Microsoft Security Blog
Microsoft Security Blog
Jina AI
Jina AI
G
GRAHAM CLULEY
D
Darknet – Hacking Tools, Hacker News & Cyber Security
C
Cyber Attacks, Cyber Crime and Cyber Security
A
About on SuperTechFans
Vercel News
Vercel News
The Cloudflare Blog
Cisco Talos Blog
Cisco Talos Blog
小众软件
小众软件
MyScale Blog
MyScale Blog
I
InfoQ
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
人人都是产品经理
人人都是产品经理
The Hacker News
The Hacker News
S
Security Affairs
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
MongoDB | Blog
MongoDB | Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
量子位
酷 壳 – CoolShell
酷 壳 – CoolShell
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
F
Fortinet All Blogs
Latest news
Latest news
Last Week in AI
Last Week in AI
博客园 - 叶小钗
H
Heimdal Security Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
V
Vulnerabilities – Threatpost
Project Zero
Project Zero

Datadog | The Monitor blog

Introducing our open source AI-native SAST Instrument and monitor Boomi integration flows with OpenTelemetry and Datadog Not all index scans are equal: How we cut query latency by over 99% Platform engineering metrics: What to measure and what to ignore Integrate Recorded Future threat intelligence with Datadog Cloud SIEM CI/CD security: threat modeling using a MITRE-style threat matrix CI/CD security: How to secure your GitHub ecosystem Ingress NGINX is EOL: A practical guide for migrating to Kubernetes Gateway API Operating agentic AI with Amazon Bedrock AgentCore and Datadog LLM Observability: Lessons from NTT DATA Introducing the Datadog Code Security MCP Capture and analyze custom heatmaps in Session Replay Understand session replays faster with AI summaries and smart chapters Monitor ClickHouse query performance with Datadog Database Monitoring How we designed empathetic alert sounds for on-call engineers Search and act across Datadog to resolve issues faster with Bits Assistant Measure the business impact of every product change with Datadog Experiments Analyzing round trip query latency Configuring JavaScript caches for better performance Introducing Bits AI Dev Agent for Code Security Datadog achieves ISO 42001 certification for responsible AI Monitor Nutanix clusters, hosts, and VMs with Datadog Monitor Juniper Mist in Datadog A new Host Map for modern infrastructure Annotate traces to improve LLM quality with Datadog LLM Observability What’s new in Cloud SIEM: AI-powered investigations, enhanced threat intelligence, and scalable security operations Explore Kubernetes with native OpenTelemetry data Monitor Oracle Fusion Cloud Applications with Datadog Announcing the Datadog Terraform provider v4.0.0 Scaling Kubernetes workloads on custom metrics How to design cloud environments for AI-powered threat analysis Monitor Aruba Central in Datadog How we centralize and remediate risks with Datadog Case Management Accelerate incident response with Datadog and ServiceNow Monitor your application and network load balancer logs Understanding Karpenter architecture for Kubernetes autoscaling Tools for collecting metrics and logs from Karpenter Monitor Karpenter with Datadog What your product data is actually saying Key metrics for monitoring Karpenter Securing Datadog’s platform in the AI age: The role of observability data Four ways engineering teams use the Datadog MCP Server to power AI agents Approaching your observability migration with the right mindset Meet the new Bits AI SRE: Deeper reasoning, twice as fast Key learnings from the 2026 State of DevSecOps study Use plain English to query your multi-cloud infrastructure in Resource Catalog Simplifying troubleshooting across the user journey with Datadog Synthetic Monitoring Protect your OCI resources with Datadog Cloud Security This Month in Datadog - February 2026 Amazon EC2 security: How misconfigured and public AMIs expand your cloud attack surface Enable end-to-end visibility into your Java apps with a single command Measure and improve mobile app startup performance with Datadog RUM Evaluating our AI Guard application to improve quality and control cost Identify untested code across every level of your codebase Make use of guardrail metrics and stop babysitting your releases Monitor Versa Networks SD-WAN performance in Datadog Improve performance and reliability with APM Recommendations Remediate transitive vulnerabilities faster with Datadog Software Composition Analysis Generate audit-ready vulnerability and compliance reports with Datadog Sheets Monitor Fortinet FortiManager performance in Datadog Improve test coverage across codebases with Datadog Code Coverage Move fast, don’t break things: Consistent testing standards at scale Enrich logs with ServiceNow CMDB context before routing to any SIEM or logging tool Monitor Lustre with Datadog Make faster, better product decisions with Datadog Product Analytics Surface and remediate runtime posture issues with Workload Protection Findings Protect agentic AI applications with Datadog AI Guard How to optimize JavaScript code with CSS Trace Google Pub/Sub workloads in Cloud Run with Datadog Detect human names in logs with ML in Sensitive Data Scanner How we cut our NLQ agent debugging time from hours to minutes with LLM Observability Debug PostgreSQL query latency faster with EXPLAIN ANALYZE in Datadog Database Monitoring Datadog acquires Propolis Unify and correlate frontend and backend data with retention filters Scale compliance across global frameworks with Datadog Cloud Security Monitor Arista VeloCloud SD-WAN performance with Datadog Building reliable dashboard agents with Datadog LLM Observability Simplify log collection and aggregation for MSSPs with Datadog Observability Pipelines Mitigation for Node.js denial-of-service vulnerability affecting Datadog APM Automate flaky test fixes with the Bits AI Dev Agent and Test Optimization How we built an AI SRE agent that investigates like a team of engineers Datadog integrations 2025 recap: Observability for AI, security, and hybrid cloud Design effective executive dashboards with Datadog Implement dbt data quality checks with dbt-expectations Bring faster visibility into AWS Lambda functions with remote instrumentation Troubleshoot faster with the GitLab Source Code integration in Datadog How Cambia Health Solutions saved $30,000 monthly with Cloud Cost Management and the Datadog Resource Catalog Normalize any logs for Cloud SIEM with Datadog's OCSF processor Optimizing Datadog at scale: Cost-efficient observability at Zendesk Detect, diagnose, and resolve network issues easily with CNM Network Health Connect engineering errors to user impact in early-stage products Cilium configuration for Kubernetes operations at scale Designing feedback loops for progressive delivery Ship features faster and safer with Datadog Feature Flags Choosing the right OpenTelemetry Collector distribution Route your monitor alerts with Datadog monitor notification rules Automate Cloud SIEM investigations with Bits AI Security Analyst Cloud threat detection: How to identify risky activity across control and data planes Collecting Kafka performance metrics Monitoring Kafka with Datadog Monitoring Kafka performance metrics
Optimize Ruby garbage collection activity with Datadog's allocations profiler
2024-09-24 · via Datadog | The Monitor blog

One Ruby feature that embodies the principle of “optimizing for programmer happiness” is how the language uses garbage collection (GC) to automatically manage application memory. But as Ruby apps grow, GC itself can become a big consumer of system resources, and this can lead to high CPU usage and performance issues such as increased latency or reduced throughput. For this reason, it’s important for DevOps teams to keep an eye on Ruby GC activity as part of the effort to optimize application performance.

To help engineers track resource usage tied to GC and determine when this usage is problematic, Datadog’s Continuous Profiler surfaces garbage collection activity in both its flame graph and thread timeline visualizations. And now, with the general availability of the Ruby allocations profiler in version 2.3.0 of our Datadog tracing library, Continuous Profiler also lets you take your investigations even further within your Ruby applications. By revealing which parts of an application are allocating the most memory, the new allocations profiler helps you not only diagnose but also resolve GC resource consumption issues in Ruby.

In this post, we’ll explore the following topics:

How much resource usage is due to GC?

You can uncover GC activity for Ruby applications in Continuous Profiler by looking at the CPU Time profile view within the flame graph visualization and then locating the top-level Garbage Collection frame. This frame will reveal the average CPU time for GC and its corresponding percentage of the profile, as shown below:

An expanded frame revealing garbage collection activity in a flame graph

You can also drill down on GC activity in the thread timeline visualization. In this visualization, you can distinguish between minor and major GC activity and see the trigger that caused the garbage collector to start. For example, the screenshot below shows a pop-up indicating that minor GC activity has been triggered by object allocation:

A thread timeline view with a pop-up indicating minor garbage collection caused by object allocation

Determining whether GC resource usage is problematic

The point at which GC resource usage becomes problematic depends on whether the application is latency-sensitive.

For applications that are not latency-sensitive, such as some background job processes, GC resource usage may start significantly impacting the application only once it’s close to fully using all available CPU resources. In these situations, any time saved from garbage collection translates into more useful processing time.

If however the application is latency-sensitive, even a low overall percentage of GC resource usage can have an effect on tail latencies. This outsized impact occurs because GC is always triggered in response to application activity, and thus the garbage collector is often competing with the application for resources.

Which parts of the application are heavily allocating memory?

To investigate which parts of a Ruby application are responsible for allocating the most memory, you first need to install version 2.3.0 or later of the Datadog tracing library (which includes our Ruby profiler) and then enable the allocations profiler. Once enabled, the allocations profiler allows you to investigate the memory allocations made by each function (i.e., method) of your Ruby application, including allocations that were subsequently freed. It also allows you to adjust the top list to view the heaviest allocators from different perspectives, such as the top threads, files, or libraries:

A flame graph of memory allocations with a menu of top allocators expanded that shows various viewing options

Another selection, Allocated Type, allows you to view which kinds of objects have been allocated the most often, as shown below:

An expanded menu revealing the top allocated types

In this last example above, any work done to reduce the number of arrays, strings, and hashes allocated in these codepaths will help reduce GC load. This reduction can be accomplished through the use of better algorithms, better data structures, or through object reuse strategies such as object pool caches or the flyweight design pattern.

Looking into a real-world garbage collection optimization

At the Datadog DASH 2024 conference, Zach McCormick from Braze described an investigation using our allocations profiler that led to a CPU usage reduction. One of Braze’s Sidekiq services had been seeing GC use more than 10 percent of the service’s CPU time. Investigating this problem with the allocations profiler, Zach used the Top Function list to determine that the app was performing a lot of object dup (i.e., cloning) operations.

A list of top allocated functions highlighting the dup function selection

The Braze team had originally put these dup operations in place to work around a logic bug, but that issue had since been fixed in the codebase. The workaround had stayed behind and over time had become quite costly.

Removing the workaround from the codebase led to a big decrease in allocated objects. In the image below, the left window (A) shows the allocations in the service before the fix, and the right window (B) reveals the significantly reduced memory allocations after the fix.

A comparison of A and B flame graphs showing fewer allocations in the B flame graph

Accordingly, there was a reduction of time spent in garbage collection, as well as in overall CPU usage for this service. You can see the drop-off right before the 12:30 mark in the image below:

A timeseries revealing a sudden drop-off in CPU usage at a given point in time

Troubleshoot GC resource usage problems in Ruby applications with the allocations profiler

Using the Ruby allocations profiler, you can dig into problems you’ve detected with GC activity, determine their causes, and gain insights into how to fix the application to address these issues.

The allocations profiler for Ruby is now generally available and included as part of version 2.3.0 of Datadog’s tracing library.

For more information about Datadog Continuous Profiler, see our documentation. And if you’re not yet a Datadog customer, you can sign up for our 14-day free trial.