What’s the difference between StackOverflowError and OutOfMemoryError?

Technology CommunityCategory: C#What’s the difference between StackOverflowError and OutOfMemoryError?
VietMX Staff asked 3 years ago
  • OutOfMemoryError is related to Heap. To avoid: Make sure un-necessary objects are available for GC
  • StackOverflowError is related to stack. To avoid: Make sure method calls are ending (not in an infinite loop)