By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,198 Members | 1,743 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,198 IT Pros & Developers. It's quick & easy.

memory question, can you specify max memory?

P: n/a
I am getting an out of memory exception when spinning up a few hundred
threads all processing sizable amounts of XML. Is there any way to specify
min/max heap as there is with the java -Mx128 type switches to the JVM?
(don't remember the exact syntax of the jvm param)

Thanks in advance!

Derrick
Nov 16 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
>I am getting an out of memory exception when spinning up a few hundred
threads all processing sizable amounts of XML. Is there any way to specify
min/max heap as there is with the java -Mx128 type switches to the JVM?
(don't remember the exact syntax of the jvm param)


I think it's the default stack size you want to change, not the heap.
You can do that with Exitbin.exe and its /stack option. However, I
would recommend reconsidering your design first. Do you really need
hundreds of threads running? Why not use the thread pool?

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 16 '05 #2

P: n/a
I don't think so. Out of memory are not stack overflow exceptions.
Increasing the statck size here would only make things worse.

Willy.

"Mattias Sjögren" <ma********************@mvps.org> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
I am getting an out of memory exception when spinning up a few hundred
threads all processing sizable amounts of XML. Is there any way to
specify
min/max heap as there is with the java -Mx128 type switches to the JVM?
(don't remember the exact syntax of the jvm param)


I think it's the default stack size you want to change, not the heap.
You can do that with Exitbin.exe and its /stack option. However, I
would recommend reconsidering your design first. Do you really need
hundreds of threads running? Why not use the thread pool?

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

Nov 16 '05 #3

P: n/a
No you can't, the max. process space is exceeded.
The overflow is due to the amount threads you are creating, each thread has
a reserved default stack of 1MB, so if you say a few hundred threads you
take a few hundred MB as stack space alone, add to that amount the space
taken by your application (especially the XML data) and you are exceeding
the maximum size of your system's virtual memory size (free RAM size + free
page file space).
What you should do is reduce the number of threads to a reasonable number,
say # CPU + 1 if your thread procedures are executing a fair amount of IO or
simply a single thread if no IO is done at all.

WIlly.

"Derrick" <de*********@excite.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
I am getting an out of memory exception when spinning up a few hundred
threads all processing sizable amounts of XML. Is there any way to
specify
min/max heap as there is with the java -Mx128 type switches to the JVM?
(don't remember the exact syntax of the jvm param)

Thanks in advance!

Derrick

Nov 16 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.