Skip to content

Commit

Permalink
Update PR
Browse files Browse the repository at this point in the history
* GC.minimize can sometimes cause an increase in RSS due to how memory pages are managed and freed. Use only in monitor loop at the end of that loop
  • Loading branch information
abraunegg committed Jun 16, 2024
1 parent 03ecbc3 commit 828a0e4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/curlEngine.d
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ class CurlEngine {
// Perform Garbage Collection
GC.collect();
// Return free memory to the OS
GC.minimize();
//GC.minimize();
}

// We are releasing a curl instance back to the pool
Expand All @@ -232,7 +232,7 @@ class CurlEngine {
// Perform Garbage Collection
GC.collect();
// Return free memory to the OS
GC.minimize();
//GC.minimize();
}

// Initialise this curl instance
Expand Down Expand Up @@ -486,7 +486,7 @@ class CurlEngine {
// Perform Garbage Collection
GC.collect();
// Return free memory to the OS
GC.minimize();
//GC.minimize();
}
}

Expand Down Expand Up @@ -555,7 +555,7 @@ void releaseAllCurlInstances() {
// Perform Garbage Collection on the destroyed curl engines
GC.collect();
// Return free memory to the OS
GC.minimize();
//GC.minimize();
// Log that all curl engines have been released
addLogEntry("CurlEngine releaseAllCurlInstances() completed", ["debug"]);
}
Expand Down
6 changes: 1 addition & 5 deletions src/util.d
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,6 @@ bool testInternetReachability(ApplicationConfig appConfig) {
object.destroy(http);
// Perform Garbage Collection
GC.collect();
// Return free memory to the OS
GC.minimize();
}

// Execute the request and handle exceptions
Expand Down Expand Up @@ -703,8 +701,6 @@ JSONValue fetchOnlineURLContent(string url) {
object.destroy(http);
// Perform Garbage Collection
GC.collect();
// Return free memory to the OS
GC.minimize();
}

// Configure the URL to access
Expand Down Expand Up @@ -1277,7 +1273,7 @@ void setupExitScopeSignalHandler() {
extern(C) nothrow @nogc @system void exitScopeSignalHandler(int signo) {
if (signo == SIGSEGV) {
// Caught a SIGSEG but everything was shutdown cleanly .....
printf("Caught a SIGSEG but everything was shutdown cleanly .....\n");
// printf("Caught a SIGSEG but everything was shutdown cleanly .....\n");
exit(0);
}
}

0 comments on commit 828a0e4

Please sign in to comment.