mirror of https://github.com/arendst/Tasmota.git
Berry reduce detailed GC logs
This commit is contained in:
parent
1caffb353c
commit
e7ac249f8f
|
@ -1074,6 +1074,7 @@
|
||||||
#define USE_BERRY_PSRAM // Allocate Berry memory in PSRAM if PSRAM is connected - this might be slightly slower but leaves main memory intact
|
#define USE_BERRY_PSRAM // Allocate Berry memory in PSRAM if PSRAM is connected - this might be slightly slower but leaves main memory intact
|
||||||
#define USE_BERRY_IRAM // Allocate some data structures in IRAM (which is ususally unused) when possible and if no PSRAM is available
|
#define USE_BERRY_IRAM // Allocate some data structures in IRAM (which is ususally unused) when possible and if no PSRAM is available
|
||||||
// #define USE_BERRY_DEBUG // Compile Berry bytecode with line number information, makes exceptions easier to debug. Adds +8% of memory consumption for compiled code
|
// #define USE_BERRY_DEBUG // Compile Berry bytecode with line number information, makes exceptions easier to debug. Adds +8% of memory consumption for compiled code
|
||||||
|
// #define UBE_BERRY_DEBUG_GC // Print low-level GC metrics
|
||||||
// #define USE_BERRY_INT64 // Add 64 bits integer support (+1.7KB Flash)
|
// #define USE_BERRY_INT64 // Add 64 bits integer support (+1.7KB Flash)
|
||||||
#define USE_WEBCLIENT // Enable `webclient` to make HTTP/HTTPS requests. Can be disabled for security reasons.
|
#define USE_WEBCLIENT // Enable `webclient` to make HTTP/HTTPS requests. Can be disabled for security reasons.
|
||||||
// #define USE_WEBCLIENT_HTTPS // Enable HTTPS outgoing requests based on BearSSL (much ligher then mbedTLS, 42KB vs 150KB) in insecure mode (no verification of server's certificate)
|
// #define USE_WEBCLIENT_HTTPS // Enable HTTPS outgoing requests based on BearSSL (much ligher then mbedTLS, 42KB vs 150KB) in insecure mode (no verification of server's certificate)
|
||||||
|
|
|
@ -231,6 +231,7 @@ void BerryObservability(bvm *vm, int event...) {
|
||||||
slots_used_before_gc, slots_allocated_before_gc,
|
slots_used_before_gc, slots_allocated_before_gc,
|
||||||
slots_used_after_gc, slots_allocated_after_gc);
|
slots_used_after_gc, slots_allocated_after_gc);
|
||||||
|
|
||||||
|
#ifdef UBE_BERRY_DEBUG_GC
|
||||||
// Add more in-deptch metrics
|
// Add more in-deptch metrics
|
||||||
AddLog(LOG_LEVEL_DEBUG_MORE, D_LOG_BERRY "GC timing (us) 1:%i 2:%i 3:%i 4:%i 5:%i total:%i",
|
AddLog(LOG_LEVEL_DEBUG_MORE, D_LOG_BERRY "GC timing (us) 1:%i 2:%i 3:%i 4:%i 5:%i total:%i",
|
||||||
vm->micros_gc1 - vm->micros_gc0,
|
vm->micros_gc1 - vm->micros_gc0,
|
||||||
|
@ -254,6 +255,7 @@ void BerryObservability(bvm *vm, int event...) {
|
||||||
vm->gc_mark_module,
|
vm->gc_mark_module,
|
||||||
vm->gc_mark_comobj
|
vm->gc_mark_comobj
|
||||||
);
|
);
|
||||||
|
#endif
|
||||||
// make new threshold tighter when we reach high memory usage
|
// make new threshold tighter when we reach high memory usage
|
||||||
if (!UsePSRAM() && vm->gc.threshold > 20*1024) {
|
if (!UsePSRAM() && vm->gc.threshold > 20*1024) {
|
||||||
vm->gc.threshold = vm->gc.usage + 10*1024; // increase by only 10 KB
|
vm->gc.threshold = vm->gc.usage + 10*1024; // increase by only 10 KB
|
||||||
|
|
Loading…
Reference in New Issue