Click here to Skip to main content
15,887,485 members
Home / Discussions / C#
   

C#

 
QuestionCan you use sqlite in vs2022? CLOSED Pin
mo149228-Jul-22 13:18
mo149228-Jul-22 13:18 
AnswerRe: Can you use sqlite in vs2022? CLOSED Pin
OriginalGriff28-Jul-22 19:00
mveOriginalGriff28-Jul-22 19:00 
QuestionC# Set voice in Text to Speech Pin
Rockallica27-Jul-22 17:02
Rockallica27-Jul-22 17:02 
AnswerRe: C# Set voice in Text to Speech Pin
OriginalGriff27-Jul-22 20:16
mveOriginalGriff27-Jul-22 20:16 
GeneralRe: C# Set voice in Text to Speech Pin
Rockallica28-Jul-22 8:39
Rockallica28-Jul-22 8:39 
GeneralRe: C# Set voice in Text to Speech Pin
OriginalGriff28-Jul-22 8:52
mveOriginalGriff28-Jul-22 8:52 
QuestionIn C# can't introduce a formula in Excel Pin
Ismael_199927-Jul-22 12:37
Ismael_199927-Jul-22 12:37 
AnswerRe: In C# can't introduce a formula in Excel Pin
trønderen27-Jul-22 12:55
trønderen27-Jul-22 12:55 
AnswerRe: In C# can't introduce a formula in Excel Pin
Gerry Schmitz27-Jul-22 14:47
mveGerry Schmitz27-Jul-22 14:47 
GeneralRe: In C# can't introduce a formula in Excel Pin
Ismael_199928-Jul-22 7:53
Ismael_199928-Jul-22 7:53 
QuestionI having this error could anyone can help me :Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object at ValidParenthese.Solution.IsValid (System.String s) [0x00000] in <89120c6f256647e6a05011f274f6a Pin
swethamaddi26-Jul-22 23:20
swethamaddi26-Jul-22 23:20 
AnswerRe: I having this error could anyone can help me :Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object at ValidParenthese.Solution.IsValid (System.String s) [0x00000] in <89120c6f256647e6a05011f27 Pin
Richard MacCutchan26-Jul-22 23:51
mveRichard MacCutchan26-Jul-22 23:51 
AnswerRe: I having this error could anyone can help me :Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object at ValidParenthese.Solution.IsValid (System.String s) [0x00000] in <89120c6f256647e6a05011f27 Pin
Dave Kreskowiak27-Jul-22 6:57
mveDave Kreskowiak27-Jul-22 6:57 
QuestionWhat Is NullReferenceException? Object reference not set to an instance of an object i have error how to change code unable to excute below code could help me Pin
swethamaddi26-Jul-22 23:15
swethamaddi26-Jul-22 23:15 
AnswerRe: What Is NullReferenceException? Object reference not set to an instance of an object i have error how to change code unable to excute below code could help me Pin
Richard MacCutchan26-Jul-22 23:51
mveRichard MacCutchan26-Jul-22 23:51 
AnswerRe: What Is NullReferenceException? Object reference not set to an instance of an object i have error how to change code unable to excute below code could help me Pin
OriginalGriff27-Jul-22 0:04
mveOriginalGriff27-Jul-22 0:04 
AnswerRe: What Is NullReferenceException? Object reference not set to an instance of an object i have error how to change code unable to excute below code could help me Pin
Calin Negru28-Jul-22 0:11
Calin Negru28-Jul-22 0:11 
QuestionHow to convert pdf file into FileStream? Pin
Code4Ever26-Jul-22 6:35
Code4Ever26-Jul-22 6:35 
GeneralRe: How to convert pdf file into FileStream? Pin
Richard MacCutchan26-Jul-22 6:49
mveRichard MacCutchan26-Jul-22 6:49 
GeneralRe: How to convert pdf file into FileStream? Pin
Code4Ever26-Jul-22 6:59
Code4Ever26-Jul-22 6:59 
GeneralRe: How to convert pdf file into FileStream? Pin
Richard Deeming26-Jul-22 22:03
mveRichard Deeming26-Jul-22 22:03 
GeneralRe: How to convert pdf file into FileStream? Pin
Code4Ever28-Jul-22 19:52
Code4Ever28-Jul-22 19:52 
AnswerRe: How to convert pdf file into FileStream? Pin
Dave Kreskowiak26-Jul-22 7:24
mveDave Kreskowiak26-Jul-22 7:24 
First, are you looking in Task Manager to determine this?

It's lying to you. It's not showing you how much memory your app is taking. It's showing you how much is RESERVED for your app.

You have to understand how memory allocations work in the .NET CLR and how it relates to Windows memory management. The .NET CLR manages the "Managed Heap", which is what your app sees (and Task Manager does NOT). When your app allocates an object, it's allocated on the Managed Heap. When an object is freed, that memory goes back into the Managed Heap, NOT BACK TO WINDOWS!

Just because your code is not using an object anymore, that does NOT mean the memory it occupies is immediately returned to the Managed Heap!

When more objects need to be allocated, it's faster for the CLR to allocate from the Managed Heap than it is for it to find out there's not enough enough heap left, go to Windows to get another block of memory, add it to the heap, then allocate your object.

This is why you're seeing what's RESERVED for your app.

When the CLR feels the conditions are right, it cleans up the managed heap, moving objects around and freeing up objects that don't have a reference being held anymore, returning that freed memory back to the Managed Heap. This is called Garbage Collection.

When Windows needs more memory, it asks the .NET CLR for whatever it can free up. If there's sufficient space on the Managed Heap, it'll shrink the size of the heap and return that freed memory back to Windows. If your code quickly allocats lots of objects and frees them, this can give the illusion of a memory leak.

GeneralRe: How to convert pdf file into FileStream? Pin
Code4Ever26-Jul-22 7:39
Code4Ever26-Jul-22 7:39 
GeneralRe: How to convert pdf file into FileStream? Pin
Dave Kreskowiak26-Jul-22 7:45
mveDave Kreskowiak26-Jul-22 7:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.