Click here to Skip to main content
15,888,733 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
I have Windows service which is coded in VB.Net.

Service contains the main parent Thread which sleeps after interval of three minutes.

When parent Thread start the execution it create multiple Child Threads whose task is to process the query and dump the data into MYSQL related tables.

My question is that the Child Thread are created inside parent Thread,so what Garbage Collector cleans the memory occupied by the Child Thread's at an interval of three minutes or we need to manually write the script to clear the <Thread's data.

Because i get the System.OutOf.Memory.Exception which stops the execution of the service.

What I have tried:

Can any one help me to resolve this issue.
Posted
Updated 3-Aug-17 1:43am

1 solution

See Fundamentals of Garbage Collection | Microsoft Docs[^]:
Quote:
There is a managed heap for each managed process. All threads in the process allocate memory for objects on the same heap.
So the garbage collection affects the memory from all threads of a process.

If you run out of memory I suggest to reduce / optimise memory usage.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900