In-Memory OLTP 사용시 메모리 할당량 초과 오류
- Version : SQL Server 2014, 2016
SQL Server 에서 In-Memory OLTP를 사용하는 환경에서 아래와 같은 오류가 에러로그에 기록되어 있다면 현재 적용되어 있는 In-Memory 용량을 초과한 것이다.
[INFO] HkDatabaseTryAcquireUserMemory(): Database ID: [7]. Out of user memory quota: requested = 131200; available = 74641; quota = 34359738368; operation = 1. |
오류 로그에 기록된 내용은 아래와 같다.
- requested = 131200 : 요청된 바이트 수
- available = 74641 : 사용할 수 있는 바이트 수
- quota = 34359738368 : 현재 할당된 바이트 수 (Standard Edition : 32G)
- operation = 1 : 메모리 최적화 테이블 변수를 생성할 수 있도록 메모리가 요청 됨
- operation 0 : create memory optimized table
- operation 1 : create memory optimized table variable
- operation 2 : insert
- operation 3 : update
위의 메시지 외에도 사용자 어플리케이션에서는 아래와 같은 메시지를 수신하는 경우도 있다.
Msg 41823, Level 16, State 171, Line 6 Could not perform the operation because the database has reached its quota for in-memory tables. See ‘http://go.microsoft.com/fwlink/?LinkID=623028’ for more information. |
메모리 최적화 테이블 변수 사용시 루프를 사용할때 위와 같은 메모리 부족 오류가 자주 발생 할 수 있으니 주의 할 수 있도록 한다.
- 메모리 최적화 테이블변수와 701 오류 (loop 사용으로 인한 메모리 부족 오류) : http://sqlmvp.kr/220996905075
SQL Server 2016 In-Memory OLTP quotas.
Edition | In-Memory OLTP quota(per DB) |
Express | 352MB |
Web | 16GB |
Standard | 32GB |
Developer | Unlimited |
Enterprise | Unlimited |
[참고자료]
- https://blogs.msdn.microsoft.com/psssql/2017/06/07/you-may-see-out-of-user-memory-quota-message-in-errorlog-when-you-use-in-memory-oltp-feature/
- https://blogs.msdn.microsoft.com/sqlserverstorageengine/2016/11/17/in-memory-oltp-in-standard-and-express-editions-with-sql-server-2016-sp1/
2017-08-23 / 강성욱 / http://sqlmvp.kr / http://sqlangeles.com
SQL Server 2016, In memory OLTP, SQL Server, DBA, Memory optimize table, In Memory quota