You can use Visual Studio Code (VS Code) to collect and analyze memory and CPU data from your Roku RSG 2.0 SDK apps.

To collect and analyze profiling data from your RSG 2.0 SDK app with VS Code, do the following:

  1. Launch the app in debug mode.
  2. Record your running app.
  3. View the profiling data.

The profiling data shows where you can reduce resource consumption and optimize performance.

Launching an app in debug mode

You can launch an app in debug mode from VS Code by locating the app and selecting the Debug button, or by right-clicking the app and selecting Debug from the shortcut menu. VS Code launches your app on your Roku device in debug mode.

Collecting profiling data

When an RSG 2.0 SDK app is running in debug mode, you can collect CPU or memory profiling data by doing the following:

  1. In VS Code, click the Run and Debug view in the sidebar (or press Ctrl+Shift+D). VS Code adds an entry for the running app to the Call Stack panel.
  2. Click the record button or right-click the app entry and select Take Performance Profile from the shortcut menu.
  3. In the prompt, select the profiling data to collect (CPU or Heap) and the duration. A red recording icon indicates data collection has begun.
  4. Test your app to generate the profiling data you want to analyze.

Viewing profiling data

When the specified profiling duration ends, VS Code automatically stops the recording and opens the collected profiling data in a new tab. VS Code displays the data in a table view by default. You can switch to a flamegraph view by selecting the flamegraph icon in the top right corner of the Profile tab.


Did this page help you?