From 1f243258885544d1a7de558abfb2f0e8d3401f36 Mon Sep 17 00:00:00 2001 From: Arjun Nakkeeran Date: Wed, 12 Nov 2025 10:52:46 +0530 Subject: [PATCH 1/3] Upgrade to Dotnet 8 and make the GC Collect visible --- src/MemoryLeak/MemoryLeak/MemoryLeak.csproj | 2 +- src/MemoryLeak/MemoryLeak/Pages/Index.cshtml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/MemoryLeak/MemoryLeak/MemoryLeak.csproj b/src/MemoryLeak/MemoryLeak/MemoryLeak.csproj index b0bf919..c23ca21 100644 --- a/src/MemoryLeak/MemoryLeak/MemoryLeak.csproj +++ b/src/MemoryLeak/MemoryLeak/MemoryLeak.csproj @@ -1,7 +1,7 @@ - net5.0 + net8.0 true diff --git a/src/MemoryLeak/MemoryLeak/Pages/Index.cshtml b/src/MemoryLeak/MemoryLeak/Pages/Index.cshtml index 20e25b4..e1b5e6c 100644 --- a/src/MemoryLeak/MemoryLeak/Pages/Index.cshtml +++ b/src/MemoryLeak/MemoryLeak/Pages/Index.cshtml @@ -37,7 +37,7 @@

- +

From dc4d2ad89fb63746d669564e33e85db702a6b991 Mon Sep 17 00:00:00 2001 From: Arjun Nakkeeran Date: Wed, 12 Nov 2025 11:03:02 +0530 Subject: [PATCH 2/3] Add API test scrpits --- api-test/load-test/k6-load-test.js | 12 ++++++++++++ api-test/unit-test/memory-leak-apis.http | 20 ++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 api-test/load-test/k6-load-test.js create mode 100644 api-test/unit-test/memory-leak-apis.http diff --git a/api-test/load-test/k6-load-test.js b/api-test/load-test/k6-load-test.js new file mode 100644 index 0000000..887c43c --- /dev/null +++ b/api-test/load-test/k6-load-test.js @@ -0,0 +1,12 @@ +import http from 'k6/http'; +import {sleep} from 'k6'; + +export const options = { + vus: 5000, + duration: '10s', +}; + +export default function() { + http.get('https://localhost:5001/api/bigstring'); + sleep(1); +} \ No newline at end of file diff --git a/api-test/unit-test/memory-leak-apis.http b/api-test/unit-test/memory-leak-apis.http new file mode 100644 index 0000000..d0704f7 --- /dev/null +++ b/api-test/unit-test/memory-leak-apis.http @@ -0,0 +1,20 @@ +# For more info on HTTP files go to https://aka.ms/vs/httpfile +@hostAddress=https://localhost:5001 + +GET {{hostAddress}}/api/bigstring +### + +GET {{hostAddress}}/api/staticstring +### + +GET {{hostAddress}}/api/loh/200000 +### + +GET {{hostAddress}}/api/httpclient1?url=https%3A%2F%2Fnotebooklm.google%2F +### + +GET {{hostAddress}}/api/httpclient2?url=https%3A%2F%2Fnotebooklm.google%2F +### + +GET {{hostAddress}}/api/array/2000000 +### \ No newline at end of file From f3ff05ec5cb84ef944bd1f355c158468c838ac64 Mon Sep 17 00:00:00 2001 From: Arjun Nakkeeran Date: Wed, 12 Nov 2025 11:09:10 +0530 Subject: [PATCH 3/3] Change test url for http test --- api-test/unit-test/memory-leak-apis.http | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api-test/unit-test/memory-leak-apis.http b/api-test/unit-test/memory-leak-apis.http index d0704f7..3cd98f3 100644 --- a/api-test/unit-test/memory-leak-apis.http +++ b/api-test/unit-test/memory-leak-apis.http @@ -10,10 +10,10 @@ GET {{hostAddress}}/api/staticstring GET {{hostAddress}}/api/loh/200000 ### -GET {{hostAddress}}/api/httpclient1?url=https%3A%2F%2Fnotebooklm.google%2F +GET {{hostAddress}}/api/httpclient1?url=https%3A%2F%2Fgithub.com%2F ### -GET {{hostAddress}}/api/httpclient2?url=https%3A%2F%2Fnotebooklm.google%2F +GET {{hostAddress}}/api/httpclient2?url=https%3A%2F%2Fgithub.com%2F ### GET {{hostAddress}}/api/array/2000000