c# - Chronic inappropriate System.OutOfMemoryException occurrences -
here's problem should continuously-running, unattended console app: i'm seeing too-frequent app exits system.outofmemoryexception
being thrown wide variety of methods deep in call stack -- system.string.tochararray()
, or system.string.ctorchararraystartlength()
, or system.xml.xmltextreaderimpl.inittextreaderinput()
, down in system.string.concat()
call in mongocollection.save()
call's stack, , other unlikely places.
for it's worth, we're using parallel tasks, app running on server, , app's total thread count never gets on 60. in of these cases know of reason other exception thrown, outofmemoryexception makes no sense in these contexts, , creates problems:
- according taskmanager , perfmon logs, system has had minimum of 65% out of 8gb free memory when has happened, and
- while exception handlers fire & log exception, not prevent app crash, and
- there's no continuing exception without user interaction (unless suppress windows error reporting, isn't want system-wide, or run app service, possible sub-optimal our use-case)
so i'm aware of workarounds mentioned above, i'd explanation -- , ideally code-based handler -- unexpected oom exceptions, can engage appropriate continuation logic. ideas?
getting exception when using under 3gb of memory suggests running 32-bit app. build 64-bit app , able use memory available (close 8gb).
as why it's failing in first place...how large data working with? if it's not large, have looked references data being kept around longer necessary (i.e. memory leak), preventing proper gc?
Comments
Post a Comment