Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk6 min

How to Troubleshoot Selenium Screenshots When Chrome Runs Out of Memory

A practical workflow for finding whether Selenium screenshot failures come from retained page objects, Chrome subsystems, capture settings, or workload limits.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

When Chrome runs out of memory during a Selenium screenshot job, first identify which memory layer is growing: JavaScript and DOM objects, native allocations, GPU or another Chrome process. A heap snapshot can reveal retained page objects, but it cannot explain every Chrome memory failure. Measure the workload, check the browser-driver versions, and profile the layer that matches the evidence rather than assuming that headless mode, more RAM, or a Chrome flag will fix it.

1. Record what fails and when

Before changing configuration, collect enough detail to reproduce the failure and distinguish a one-time spike from memory that accumulates across jobs. These are diagnostic measurements, not universal thresholds.

As an Amazon Associate I earn from qualifying purchases.

  • Record the Chrome and ChromeDriver versions, operating system, and any container or process memory limits.
  • Note whether Chrome runs headless, which Chrome binary and command-line arguments Selenium actually uses, and how sessions are started.
  • Record the screenshot viewport and, for full-page captures, the page dimensions. Keep them consistent when comparing runs.
  • Track how many sessions run in parallel and whether memory rises after each navigation, screenshot, or repeated job.
  • Capture the exact error and whether Chrome exits, the renderer crashes, or the screenshot merely fails.

A growing process total alone does not establish a JavaScript leak. Chrome uses multiple processes and memory subsystems, and a JS heap snapshot does not account for all of them. Chromium’s documentation cautions: “No single tool can give a full view of memory usage in Chrome.” (Chromium Docs, memory tools.)

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

2. Verify Chrome and ChromeDriver setup

Check that the Chrome browser and ChromeDriver major versions match, as Selenium’s Chrome guidance recommends. That page states Selenium 4 compatibility with Chrome v75 and greater; because browser support changes, check the live guidance against the versions you actually deploy.

#1 Best Overall
Timetec 16GB KIT(2x8GB) DDR3L / DDR3 1600MHz (DDR3L-1600) PC3L-12800 / PC3-12800 Non-ECC Unbuffered 1.35V/1.5V CL11 2Rx8 Dual Rank 240 Pin UDIMM Desktop PC Computer Memory RAM(SDRAM) Module Upgrade
  • [Color] PCB color may vary (black or green) depending on production batch. Quality and performance remain consistent across all Timetec products.
  • DDR3L / DDR3 1600MHz PC3L-12800 / PC3-12800 240-Pin Unbuffered Non-ECC 1.35V / 1.5V CL11 Dual Rank 2Rx8 based 512x8
  • Module Size: 16GB KIT(2x8GB Modules) Package: 2x8GB ; JEDEC standard 1.35V, this is a dual voltage piece and can operate at 1.35V or 1.5V
  • For DDR3 Desktop Compatible with Intel and AMD CPU, Not for Laptop
  • Guaranteed Lifetime warranty from Purchase Date and Free technical support based on United States

Also verify the executable and arguments in the running process rather than relying only on local defaults. Selenium documents Chrome options such as --headless=new and --user-data-dir=.... A mismatched driver or an unintended binary is a setup issue to resolve before interpreting profiling results; it is not proof of an out-of-memory root cause.

3. Check for retained page objects with heap snapshots

Use heap snapshots when the symptom suggests that objects or DOM subtrees remain reachable after repeated page work. Google’s heap snapshot guide describes capturing and comparing snapshots to investigate retained objects.

  1. Open the affected page or reproduce the same page state in a controlled run, then take a baseline heap snapshot.
  2. Perform the suspected operation, such as navigation followed by a screenshot.
  3. Perform an inverse operation or return to a clean state, then repeat the same cycle several times.
  4. Take another snapshot and compare it with the baseline. Inspect objects that remain, detached DOM structures, and their retaining paths.
  5. If a retained reference is identified, fix the page or test cleanup and repeat the comparison to check whether the retained objects stop accumulating.

This method can reveal reachable JavaScript and DOM retention. It does not measure all native allocations, GPU use, or total memory across Chrome processes, so a flat heap does not rule out another memory problem.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Crucial 16GB DDR4 RAM, 3200MHz CL22 (or 2933MHz or 2666MHz) Laptop Memory, SODIMM 260-Pin, Compatible with 13th Gen Intel Core and AMD Ryzen 7000 - CT16G4SFRA32A
  • Boosts System Performance:16GB DDR4 laptop memory that operates at 3200MHz to improve multitasking and system responsiveness for smoother performance
  • Easy Installation: Upgrade your laptop RAM with ease—no computer skills required Follow step-by-step how-to guides available at Crucial for a smooth, worry-free installation
  • Compatibility Guaranteed: Ensure seamless compatibility with your laptop by using the Crucial System Scanner or Crucial Upgrade Selector—get accurate recommendations for your specific device
  • Trusted Micron Quality: Backed by 42 years of memory expertise, this DDR4 RAM is rigorously tested at both component and module levels, ensuring top performance and reliability for your Mac system
  • ECC Type = Non-ECC, Form Factor = SODIMM, Pin Count = 260-pin, PC Speed = PC4-25600, Voltage = 1.2V, Rank and Configuration = 1Rx8 or 2Rx8

4. Choose a profiler for the suspected memory layer

Chromium documents several tools because Chrome memory use spans different contexts. Match the tool to the question; profiling itself can be costly, especially when traces or dumps are large.

Suspected issue Useful tool or method What it helps show Limit to keep in mind
Objects or DOM retained by page activity DevTools heap snapshots and comparisons Reachable JS objects, retained DOM, and retaining paths Does not provide a complete view of native, GPU, or all-process memory.
Allocation by Chrome process or subsystem Global Memory Dumps or a memory-infra trace Per-process and subsystem allocation information Self-reported subsystem statistics can omit resources; large traces can burden the tracing UI.
Native heap allocation changes over time Heap dumps and diff_heap_profiler.py Changes in native heap allocations Use the result in context; it is not a universal accounting of every Chrome resource.

Chromium’s memory tooling documentation explains the different coverage and blind spots. If the data collection starts consuming substantial resources or the trace becomes difficult to inspect, reduce the profiling scope and repeat a smaller reproduction.

5. Isolate screenshot-specific effects

Test whether memory use changes with capture size or frequency, but hold other variables steady. Compare the same page and session pattern while changing one capture factor at a time: viewport dimensions, full-page versus viewport capture, or captures per navigation. Do not infer that all Selenium screenshots use the same buffering behavior as DevTools tracing.

Rank #3
A-Tech DDR4 RAM 8GB 2666MHz PC4-21300 SODIMM Laptop Memory | Non-ECC PC4-2666V CL19 260-Pin SO-DIMM 1.2V Notebook Computer Memory Upgrade Module
  • A-Tech 8GB RAM Module, DDR4 SO-DIMM 260-Pin, 2666MHz / 2667MHz PC4-21300 (PC4-2666V)
  • Non-ECC Unbuffered, JEDEC DDR4 Standard 1.2V Operating Voltage
  • Compatible with select DDR4 SODIMM capable Laptop, Notebook, Mini PC, and All-in-One (AIO) computer systems. Please verify your system's memory type, form factor, and maximum supported capacity before purchasing
  • Not compatible with desktop (DIMM), DDR2, DDR3, DDR5, ECC Registered (RDIMM), ECC Load Reduced (LRDIMM), or ECC Unbuffered (ECC UDIMM) memory types
  • Increases available memory capacity to enhance system responsiveness, application performance, and multitasking capabilities.

Tracing screenshots have their own buffer limits

The DevTools Protocol’s Tracing documentation describes screenshotMaxSize and screenshotMaxCount for screenshots recorded in a tracing session; their combined footprint is clamped to a per-session screenshot budget. This is specific to tracing and does not establish that Selenium’s ordinary screenshot command retains those same buffers.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

HeadlessExperimental is not the ordinary Selenium screenshot path

The HeadlessExperimental protocol says a requested screenshot is returned as base64-encoded image data and can fail, for example during renderer initialization. Treat that as protocol-specific behavior, not proof that Selenium’s standard screenshot command has the same failure mode.

Headless mode is not a memory fix by itself

Chromium’s headless guidance describes server-side use, including bitmap generation, but does not establish that headless mode inherently uses less memory or fixes out-of-memory failures. The same README says the old headless implementation stopped being part of the Chrome binary as of M132 and directs users who need old functionality to chrome-headless-shell; verify this version-specific guidance against your deployed Chrome.

Rank #4
Crucial 8GB DDR4 RAM 3200MHz (PC4-25600), Downclockable to 2933/2666MHz Laptop Memory, SODIMM 260-Pin CL22, Compatible with 13th Gen Intel Core and AMD Ryzen 7000 - CT8G4SFRA32A
  • Boosts System Performance: 8GB DDR4 laptop memory that operates at 3200MHz, 2933MHz, or 2666MHz to improve multitasking and system responsiveness for smoother performance
  • Easy Installation: Upgrade your laptop RAM with ease—no computer skills required Follow step-by-step how-to guides available at Crucial for a smooth, worry-free installation
  • Compatibility Guaranteed: Ensure seamless compatibility with your laptop by using the Crucial System Scanner or Crucial Upgrade Selector—get accurate recommendations for your specific device
  • Trusted Micron Quality: Backed by 42 years of memory expertise, this DDR4 RAM is rigorously tested at both component and module levels, ensuring top performance and reliability
  • ECC Type Non-ECC, Form Factor SODIMM, Pin Count 260-pin, PC Speed PC4-25600, Voltage 12V, Rank and Configuration 1Rx16, 1Rx8 or 2Rx8

6. Test mitigations one at a time

Once you have a reproducible case and measurements, compare a single session with the failing concurrency, then vary only one factor per run. Candidate factors include capture frequency, viewport size, page cleanup, and session lifetime.

  • If snapshots show retained page references, fix those references or cleanup behavior and validate with another snapshot comparison.
  • If process or subsystem usage dominates, profile that layer and then adjust workload or host/container capacity based on measured demand.
  • If memory rises only under parallel sessions, test lower concurrency before changing multiple browser flags or increasing capacity.
  • If the failure tracks capture dimensions or frequency, reduce the implicated factor and confirm the improvement under the same workload.

The sources do not establish a universal RAM allocation or concurrency ceiling for Selenium screenshot jobs. Choose capacity and concurrency from measurements of your pages, browser version, and runtime limits.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

7. Troubleshooting symptoms and next checks

Symptom Likely next check Action
Memory rises with each repeated page cycle Whether objects or DOM remain reachable Compare heap snapshots around the operation and its reverse; inspect retained objects and retaining paths.
Heap looks stable but Chrome still approaches its limit Native, GPU, or other process/subsystem usage Use a Global Memory Dump or memory-infra trace; do not treat the JS heap as total Chrome memory.
Failure occurs with parallel jobs but not one session Concurrency and host/container limits Compare one session with the failing concurrency, holding page and capture settings constant.
Failure appears tied to full-page or large captures Capture dimensions and frequency Control the viewport and page dimensions, then vary capture size or frequency separately.
Driver cannot start or behaves inconsistently Chrome/ChromeDriver versions and actual binary Match their major versions and confirm the executable and command-line arguments in use.
A trace becomes huge or difficult to inspect Profiling scope and overhead Capture a smaller reproduction; large traces and dumps can overwhelm the tracing UI.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If managing Chrome and ChromeDriver is not the job you want to maintain, ScreenshotNeo provides a website screenshot API and MCP server. One GET request can return a PNG, JPEG, WebP, or PDF. For example, this cURL request saves a WebP screenshot of Stripe; replace the URL with the page you need. See the ScreenshotNeo API documentation for request options.

Best Value
Timetec 8GB DDR3L / DDR3 1600MHz (DDR3L-1600) PC3L-12800 / PC3-12800(PC3L-12800S) Non-ECC Unbuffered 1.35V/1.5V CL11 2Rx8 Dual Rank 204 Pin SODIMM Laptop Notebook PC Computer Memory RAM Module Upgrade
  • [Specs] DDR3L / DDR3 1600MHz PC3L-12800 / PC3-12800 204-Pin Unbuffered Non ECC 1.35V CL11 Dual Rank 2Rx8 based 512x8
  • [Size] Module Size: 8GB Package: 1x8GB
  • [Voltage] JEDEC standard 1.35V, this is a dual voltage piece and can operate at 1.35V or 1.5V
  • [Compatibility] Compatible with DDR3 Laptop / Notebook PC, Mini PC, All in one Device
  • [Color] PCB Color is Green

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

ScreenshotNeo accepts cookie or consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing, and responses identify page verdict and billing status in headers. Its MCP server offers take_screenshot, get_page_info, and capture_pdf for Claude, Cursor, and other MCP clients. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000.

Sign up free for 1,000 screenshots a month, no card required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Frequently Asked Questions

Does a JavaScript heap snapshot show all Chrome memory?

No. It helps inspect reachable JavaScript objects and DOM retention, but it does not cover all native, GPU, or other process memory.

Does headless Chrome use less memory for Selenium screenshots?

The cited Chromium guidance supports headless use for server-side bitmap generation but does not say headless inherently reduces memory or resolves out-of-memory failures.

Do the DevTools tracing screenshot limits apply to every Selenium screenshot?

No. The documented screenshot buffer settings apply to screenshots captured for a tracing session; they do not establish the same buffering behavior for Selenium’s ordinary screenshot command.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.