Legacy Documentation: Version 5.4
LanguageEnglish
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

Profiler.maxNumberOfSamplesPerFrame

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Sumbission failed

For some reason your suggested change could not be submitted. Please try again in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

public static var maxNumberOfSamplesPerFrame: int;
public static int maxNumberOfSamplesPerFrame;

Description

Resize the profiler sample buffers to allow the desired amount of samples per thread.

If the scene is very complex, the number of samples recorded for one frame can surpass the reserved number of samples. The preallocated buffers can then be resized using this API. If dynamic resizing is desired, set this value to -1. This will allow the profiler to increase memory to not skip frames.

The default value for maxNumberOfSamplesPerFrame is 512K samples per thread. The maximum value is 8M samples per thread unless -1 is assigned.