From 5f362712569a88ffb85a83a0485f01043159896a Mon Sep 17 00:00:00 2001 From: hughbarney Date: Mon, 7 Feb 2022 23:05:59 +0000 Subject: [PATCH] Pastel: call process.memory(false), avoid triggering a GC event --- apps/pastel/ChangeLog | 2 ++ apps/pastel/metadata.json | 2 +- apps/pastel/pastel.app.js | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/pastel/ChangeLog b/apps/pastel/ChangeLog index c81d0cacc2..570c37507c 100644 --- a/apps/pastel/ChangeLog +++ b/apps/pastel/ChangeLog @@ -11,3 +11,5 @@ 0.11: Changed cycle on minute to prevInfo to avoid the 2nd one being the blank line 0.12: Removed dependancy on widpedom, now uses Bangle.getHealthStatus("day").steps which requires 2.11.27 firmware to reset at midnight +0.13: call process.memory(false) to avoid triggering a GC of memory + supported in pre 2.12.13 firmware diff --git a/apps/pastel/metadata.json b/apps/pastel/metadata.json index 1a311599cf..61b6368425 100644 --- a/apps/pastel/metadata.json +++ b/apps/pastel/metadata.json @@ -2,7 +2,7 @@ "id": "pastel", "name": "Pastel Clock", "shortName": "Pastel", - "version": "0.12", + "version": "0.13", "description": "A Configurable clock with custom fonts, background and weather display. Has a cyclic information line that includes, day, date, battery, sunrise and sunset times. Requires firmware 2.11.27", "icon": "pastel.png", "dependencies": {"mylocation":"app","weather":"app"}, diff --git a/apps/pastel/pastel.app.js b/apps/pastel/pastel.app.js index d9dfb0da52..5def5737c4 100644 --- a/apps/pastel/pastel.app.js +++ b/apps/pastel/pastel.app.js @@ -83,7 +83,7 @@ const infoData = { ID_SS: { calc: () => 'Sunset: ' + sunSet }, ID_STEP: { calc: () => 'Steps: ' + getSteps() }, ID_BATT: { calc: () => 'Battery: ' + E.getBattery() + '%' }, - ID_MEM: { calc: () => {var val = process.memory(); return 'Ram: ' + Math.round(val.usage*100/val.total) + '%';} }, + ID_MEM: { calc: () => {var val = process.memory(false); return 'Ram: ' + Math.round(val.usage*100/val.total) + '%';} }, ID_ID: { calc: () => {var val = NRF.getAddress().split(':'); return 'Id: ' + val[4] + val[5];} }, ID_FW: { calc: () => 'Fw: ' + process.env.VERSION } };