Currently devel doesn't allow to override KINT configuration in a clean way. Hopefully this will be possible some day via setting in UI or drupal setting override in settings.php Until this happens you may use this dirty trick in settings.php to override the setting.
See issues:
- https://www.drupal.org/node/2647298
- https://www.drupal.org/project/devel/issues/2277303
- https://www.drupal.org/project/devel/issues/2277303
Simply copy this into your settings.php and change the value accordingly (Kint default: 7)
// Change kint maxLevels setting:
include_once(DRUPAL_ROOT . '/modules/contrib/devel/kint/kint/Kint.class.php');
if(class_exists('Kint')){
// Set the maxlevels to prevent out-of-memory. Currently there doesn't seem to be a cleaner way to set this:
Kint::$maxLevels = 4;
}
// Change kint maxLevels setting:
if (class_exists('Kint')) {
\Kint::$depth_limit = 5;
}
Just in case someone isn't quite sure about how to use it when is having the memory error (running out of memory) now a days with Drupal 8/9 just go to your settings.php or maybe a settings.local.php (for those who use it) and place this:
note that as @radube said, for kint 4 it suffered a change from $depth_limit to $max_depth (thanks mate!)
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Si tienes el problema de usar kint pero el sitio se queda sin memoria, utiliza el codigo anterior, directamente en el archivo settings.php o tal vez settings.local.php