---
title: 플레이어의 메모리 카운터 액세스
product: Unity Editor
version: '6000.0'
latest_version: '7000.0'
status: This page documents version 6000.0. The latest version is 7000.0.
canonical: https://docs.unity.com/ko-kr/engine/6000.0/manual/analysis/profiler/visualizing-data/memory/counters-players
latest_url: https://docs.unity.com/ko-kr/engine/7000.0/manual/analysis/profiler/visualizing-data/memory/counters-players.md
last_updated: 2026-10-30
generated_at: 2026-11-19T21:46:40.415Z
locale: ko-kr
---

# 플레이어의 메모리 카운터 액세스

> 빌드된 플레이어에 메모리 지표를 표시합니다.

플레이어에서 [ProfilerRecorder API](/engine/6000.0/script-reference/unity/profiling/profilerrecorder.md)를 사용하여 Memory Profiler 모듈의 카운터에 액세스할 수 있습니다.

다음 예제에는 **총 예약 메모리**, **GC 예약 메모리** 및 **시스템 사용 메모리** 지표를 수집하고 이를 [`GUI.TextArea`](/engine/6000.0/script-reference/unityengine/gui/textarea.md)로 표시하는 간단한 스크립트가 포함되어 있습니다. Memory Profiler 모듈 정보는 [`ProfilerCategory.Memory`](/engine/6000.0/script-reference/unity/profiling/profilercategory/memory.md) Profiler 범주에 속합니다.

```language-csharp
using System.Text;
using Unity.Profiling;
using UnityEngine;

public class MemoryStatsScript : MonoBehaviour
{
    string statsText;
    ProfilerRecorder totalReservedMemoryRecorder;
    ProfilerRecorder gcReservedMemoryRecorder;
    ProfilerRecorder systemUsedMemoryRecorder;

    void OnEnable()
    {
        totalReservedMemoryRecorder = ProfilerRecorder.StartNew(ProfilerCategory.Memory, "Total Reserved Memory");
        gcReservedMemoryRecorder = ProfilerRecorder.StartNew(ProfilerCategory.Memory, "GC Reserved Memory");
        systemUsedMemoryRecorder = ProfilerRecorder.StartNew(ProfilerCategory.Memory, "System Used Memory");
    }

    void OnDisable()
    {
        totalReservedMemoryRecorder.Dispose();
        gcReservedMemoryRecorder.Dispose();
        systemUsedMemoryRecorder.Dispose();
    }

    void Update()
    {
        var sb = new StringBuilder(500);
        if (totalReservedMemoryRecorder.Valid)
            sb.AppendLine($"Total Reserved Memory: {totalReservedMemoryRecorder.LastValue}");
        if (gcReservedMemoryRecorder.Valid)
            sb.AppendLine($"GC Reserved Memory: {gcReservedMemoryRecorder.LastValue}");
        if (systemUsedMemoryRecorder.Valid)
            sb.AppendLine($"System Used Memory: {systemUsedMemoryRecorder.LastValue}");
        statsText = sb.ToString();
    }

    void OnGUI()
    {
        GUI.TextArea(new Rect(10, 30, 250, 50), statsText);
    }
}
```

다음 스크린샷은 [Tanks! 튜토리얼 프로젝트](https://assetstore.unity.com/packages/essentials/tutorial-projects/tanks-tutorial-46209)에 스크립트를 추가한 결과를 보여줍니다.


**Tanks! tutorial with the overlaid memory information:**
![](/api/media?file=/engine/6000.0/media/images/profiler-tanks-memory-overlay.png)

이 정보는 릴리스 플레이어에서 사용할 수 있으며, 다른 [High Level 카운터도 Memory Profiler 모듈](/engine/6000.0/manual/analysis/profiler/visualizing-data/memory/memory.md)에서 사용할 수 있습니다. 프로파일러 창의 커스텀 모듈에서 선택한 메모리 카운터를 보려면 [프로파일러 모듈 에디터를 사용하여](/engine/6000.0/manual/analysis/profiler/customizing/creating-custom-modules/module-editor.md) 차트를 구성하십시오.

코드에 프로파일러 정보를 추가하는 방법에 대한 자세한 내용은 코드에 [프로파일링 정보 추가](/engine/6000.0/manual/analysis/profiler/customizing/adding-information-code.md)를 참조하십시오.

## 추가 리소스##additional-resources

* [프로파일러 카운터 참조](/engine/6000.0/manual/analysis/profiler/counters-reference.md)
* [코드에 프로파일링 정보 추가](/engine/6000.0/manual/analysis/profiler/customizing/adding-information-code.md)
* [프로파일러 카운터 시각화](/engine/6000.0/manual/analysis/profiler/customizing/adding-information-code/creating-custom-counters.md)
* [Memory Profiler 모듈 참조](/engine/6000.0/manual/analysis/profiler/visualizing-data/memory/memory.md)
