PyCharm 2024.3 Help

Managing Variables Loading Policy

PyCharm debugging model provides three policies for loading values of variables:

  • Synchronously: variables are loaded all together.

  • Asynchronously: variables are loaded separately.

  • On demand: variables are loaded on user's request.

By default, variables are loaded asynchronously. To change the loading policy, click Manage the loading policy in the Debug Tool dialog toolbar, navigate to Settings | Variables Loading Policy, and select the target policy from the list.

Select the variables loading policy

Note that any changes in the loading policies become effective after you rerun the debugging process.

Enable synchronous loading of variables

  1. Select the corresponding option in the Variables Loading Policy list.

  2. Launch a debugging session.

Debugger shows the Collecting data message, and after that the variables' values are loaded.

Manage the asynchronous loading of variables

  1. This policy is enabled by default. You need to enable it using the Variables Loading Policy settings of the Debug tool dialog only when you're changing any previously selected policy.

  2. If loading a variable takes a long time, the debugger shows ...Loading Value. When the loading is low, you might see the Loading timed out messages.

    Mind the warning message in the Variables that prompts switching to the on demand policy.

    Click Switch to loading on demand in the warning to enable the On demand policy.

Load variables on demand

  1. To enable the On demand variables loading policy, choose the corresponding option in the Variables Loading Policy settings of the Debug tool dialog or click the Switch to loading on demand link in the Variables area of the Debug tool dialog.

  2. When the debugger stops at a breakpoing, you will see Show Value messages next to variables. Click them to load variables' values.

    Show Value for On Demand Variables Loading Policy

Preview big data collections

When you operate with the substantial amount of data, you need to preview data collections with hundreds of elements. By default, you can preview only the first 100 elements. To load the remaining data:

  1. Expand the target variable in the Variables tab.

  2. Scroll down to the latest visible element.

  3. Double-click or press Enter to see 100 more remaining elements.

Last modified: 11 February 2024