Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
  • Blog
  • Pricing
  • Documentation
Yandex project
© 2025 Yandex.Cloud LLC
All solutions
    • All solutions for ClickHouse
    • Fixing the request execution error - Exception Memory limit (total) exceeded

In this article:

  • Issue description
  • Solution
  • If the issue persists
  1. ClickHouse
  2. Fixing the request execution error - Exception Memory limit (total) exceeded

Fixing the request execution error: Exception Memory limit (total) exceeded

Written by
Yandex Cloud
Updated at November 27, 2023
  • Issue description
  • Solution
  • If the issue persists

Issue descriptionIssue description

When executing a query in ClickHouse, you get this error:

DB::Exception: Memory limit (total) exceeded: would use XX.XX GiB (attempt to allocate chunk of XXXXXXXX bytes), maximum: XX.X GiB. (MEMORY_LIMIT_EXCEEDED), Stack trace (when copying this message, always include the lines below)

SolutionSolution

This error indicates that the database query size exceeds the user's RAM limit. You can increase it via the UI, on the Users tab. You need to change the max_memory_usage parameter.

Note that this limit should not exceed the max_server_memory_usage parameter.

If user management via SQL is enabled in the cluster, you can set this parameter:

  • At the session level, via set max_memory_usage
  • For all users by default, by creating one settings profile.

If the issue persistsIf the issue persists

If the above actions didn't help, create a request for support.
When creating the request, provide the following information:

  1. ID of a Managed Service for Clickhouse cluster
  2. Database query code
  3. Full text of the error message.

Was the article helpful?

Previous
All solutions for ClickHouse
Next
All solutions for Cloud CDN
Yandex project
© 2025 Yandex.Cloud LLC