@rsdk/gc 5.12.0-next.8 → 5.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/gc.service.d.ts +2 -0
- package/dist/gc.service.js +8 -1
- package/dist/gc.service.js.map +1 -1
- package/package.json +2 -2
- package/src/gc.service.ts +9 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
+
|
|
6
|
+
## [5.12.0](https://github.com/R-Vision/rsdk/compare/v5.12.0-next.9...v5.12.0) (2026-05-05)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @rsdk/gc
|
package/dist/gc.service.d.ts
CHANGED
|
@@ -2,7 +2,9 @@ import { UtilsGCConfig } from './config';
|
|
|
2
2
|
export declare class UtilsGCService {
|
|
3
3
|
private readonly gcConfig;
|
|
4
4
|
private rss;
|
|
5
|
+
private intervalHandle;
|
|
5
6
|
constructor(gcConfig: UtilsGCConfig);
|
|
6
7
|
onApplicationBootstrap(): void;
|
|
8
|
+
onApplicationShutdown(): void;
|
|
7
9
|
check(): void;
|
|
8
10
|
}
|
package/dist/gc.service.js
CHANGED
|
@@ -17,6 +17,7 @@ const config_1 = require("./config");
|
|
|
17
17
|
let UtilsGCService = class UtilsGCService {
|
|
18
18
|
gcConfig;
|
|
19
19
|
rss;
|
|
20
|
+
intervalHandle;
|
|
20
21
|
constructor(gcConfig) {
|
|
21
22
|
this.gcConfig = gcConfig;
|
|
22
23
|
this.rss = process.memoryUsage().rss;
|
|
@@ -24,11 +25,17 @@ let UtilsGCService = class UtilsGCService {
|
|
|
24
25
|
onApplicationBootstrap() {
|
|
25
26
|
if (this.gcConfig.forceCleanEnabled) {
|
|
26
27
|
(0, node_v8_1.setFlagsFromString)('--expose_gc');
|
|
27
|
-
setInterval(() => {
|
|
28
|
+
this.intervalHandle = setInterval(() => {
|
|
28
29
|
this.check();
|
|
29
30
|
}, this.gcConfig.checkIntervalSec.millis());
|
|
30
31
|
}
|
|
31
32
|
}
|
|
33
|
+
onApplicationShutdown() {
|
|
34
|
+
if (this.intervalHandle) {
|
|
35
|
+
clearInterval(this.intervalHandle);
|
|
36
|
+
this.intervalHandle = undefined;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
32
39
|
check() {
|
|
33
40
|
const rss = process.memoryUsage().rss;
|
|
34
41
|
const limitRss = this.rss * (1 + this.gcConfig.rssIncreasePercent / 100);
|
package/dist/gc.service.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gc.service.js","sourceRoot":"","sources":["../src/gc.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,qCAA6C;AAC7C,qCAA0C;AAE1C,qCAAyC;AAGlC,IAAM,cAAc,GAApB,MAAM,cAAc;
|
|
1
|
+
{"version":3,"file":"gc.service.js","sourceRoot":"","sources":["../src/gc.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,qCAA6C;AAC7C,qCAA0C;AAE1C,qCAAyC;AAGlC,IAAM,cAAc,GAApB,MAAM,cAAc;IAII;IAHrB,GAAG,CAAS;IACZ,cAAc,CAA6B;IAEnD,YAA6B,QAAuB;QAAvB,aAAQ,GAAR,QAAQ,CAAe;QAClD,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,GAAG,CAAC;IACvC,CAAC;IAED,sBAAsB;QACpB,IAAI,IAAI,CAAC,QAAQ,CAAC,iBAAiB,EAAE,CAAC;YACpC,IAAA,4BAAkB,EAAC,aAAa,CAAC,CAAC;YAClC,IAAI,CAAC,cAAc,GAAG,WAAW,CAAC,GAAG,EAAE;gBACrC,IAAI,CAAC,KAAK,EAAE,CAAC;YACf,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,MAAM,EAAE,CAAC,CAAC;QAC9C,CAAC;IACH,CAAC;IAED,qBAAqB;QACnB,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;YACxB,aAAa,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;YACnC,IAAI,CAAC,cAAc,GAAG,SAAS,CAAC;QAClC,CAAC;IACH,CAAC;IAED,KAAK;QACH,MAAM,GAAG,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,GAAG,CAAC;QACtC,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,kBAAkB,GAAG,GAAG,CAAC,CAAC;QAEzE,IAAI,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;YACnB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACjB,CAAC;aAAM,IAAI,GAAG,GAAG,QAAQ,EAAE,CAAC;YAC1B,MAAM,EAAE,GAAG,IAAA,yBAAe,EAAC,IAAI,CAAC,CAAC;YAEjC,EAAE,EAAE,CAAC;YAEL,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,GAAG,CAAC;QACvC,CAAC;IACH,CAAC;CACF,CAAA;AAtCY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,mBAAU,GAAE;qCAK4B,sBAAa;GAJzC,cAAc,CAsC1B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsdk/gc",
|
|
3
|
-
"version": "5.12.0
|
|
3
|
+
"version": "5.12.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -30,5 +30,5 @@
|
|
|
30
30
|
"reflect-metadata": "^0.1.12 || ^0.2.0",
|
|
31
31
|
"rxjs": "^7.1.0"
|
|
32
32
|
},
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "e37dbd5dfabbc6150e3d22d545b03ee5e41bf6a4"
|
|
34
34
|
}
|
package/src/gc.service.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { UtilsGCConfig } from './config';
|
|
|
7
7
|
@Injectable()
|
|
8
8
|
export class UtilsGCService {
|
|
9
9
|
private rss: number;
|
|
10
|
+
private intervalHandle: NodeJS.Timeout | undefined;
|
|
10
11
|
|
|
11
12
|
constructor(private readonly gcConfig: UtilsGCConfig) {
|
|
12
13
|
this.rss = process.memoryUsage().rss;
|
|
@@ -15,12 +16,19 @@ export class UtilsGCService {
|
|
|
15
16
|
onApplicationBootstrap(): void {
|
|
16
17
|
if (this.gcConfig.forceCleanEnabled) {
|
|
17
18
|
setFlagsFromString('--expose_gc');
|
|
18
|
-
setInterval(() => {
|
|
19
|
+
this.intervalHandle = setInterval(() => {
|
|
19
20
|
this.check();
|
|
20
21
|
}, this.gcConfig.checkIntervalSec.millis());
|
|
21
22
|
}
|
|
22
23
|
}
|
|
23
24
|
|
|
25
|
+
onApplicationShutdown(): void {
|
|
26
|
+
if (this.intervalHandle) {
|
|
27
|
+
clearInterval(this.intervalHandle);
|
|
28
|
+
this.intervalHandle = undefined;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
24
32
|
check(): void {
|
|
25
33
|
const rss = process.memoryUsage().rss;
|
|
26
34
|
const limitRss = this.rss * (1 + this.gcConfig.rssIncreasePercent / 100);
|