stack-size

cc1plus.exe crash when using large precompiled header file

眉间皱痕 提交于 2019-12-05 01:42:22
I'm having an issue using precompiled header files with MinGW. The compiler seems to find the precompiled header file but cc1plus.exe crashes immediately after (cc1plus.exe has stopped working). I've understood that this might be in connection with cc1plus.exe's low stack size, so I did the following to increase it: editbin cc1plus.exe /STACK 33554432 and I also tried to no avail: editbin cc1plus.exe /STACK 32768k This however did not solve it as it still keeps crashing whenever I try to compile my application. By the way I'm using the latest MinGw (gcc v 4.6.2) and the latest Eclipse CDT if

Safe thread stack size?

断了今生、忘了曾经 提交于 2019-12-04 08:46:48
I am writing some code that spawns quite a few threads (about 512 at the moment, but that could get higher in the future). Each of the threads only performs a small amount of operations, so I want the overhead that the threads place on the system to be kept at a minimum. I am setting the stack size using pthread_attr_setstacksize() , and I can get the minimal allowed stack size from PTHREAD_STACK_MIN . But my question is: Is it safe to use PTHREAD_STACK_MIN for the thread stack size? How do I go about calculating how much stack I need? Are there any hidden overheads that I will need to add on

Computing method call stack size for checking StackOverflowException

安稳与你 提交于 2019-12-04 02:24:08
Today morning I answered a question which is related to StackoverflowException . The person has asked when Stackoverflow exception occurs See this link Simplest ways to cause stack overflow in C#, C++ and Java So my question is that is there any method by which we can compute the method call stacks size dynamically in our program and then applying a check before calling a method which checks whether method call stack has space to accommodate it or not to prevent StackOverflowException. As I am a java person I am looking for java but also looking for explanation related to the concept without

What is the stack size of a BackgroundWorker DoWork Thread? Is there way to change it?

空扰寡人 提交于 2019-12-01 11:04:39
I know for a C# main program the stack size 1 MB (32-bit and any) or 4 MB (64-bit), see Why is stack size in C# exactly 1 MB? What is the default stack size of the BackgroundWorker DoWork thread? Is there a way to change the stack size of the BackgroundWorker DoWork thread beside creating another thread like the following example: private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e) { Thread thread = new Thread(delegate() { // do work with larger stack size }, 8192 * 1024); thread.Start(); thread.Join(); } I'm using a BackgroundWorker because I've a Windows Forms application

Cmake change stack size

◇◆丶佛笑我妖孽 提交于 2019-12-01 11:02:11
Is there a way to change stack size from the Cmake ? I only found one forum thread mentioning CMAKE_CXX_STACK_SIZE but I couldn't find the documentation for this command. Ideally the command should work for both Visual Studio C++ and gcc . I don't have VS at the moment, but the following three CMake commands all work for me on MinGW/GCC (replace <target> with what you entered into add_executable() ): target_link_libraries(<target> PRIVATE "-Wl,--stack,10000000") OR set_target_properties(<target> PROPERTIES LINK_FLAGS -Wl,--stack,10000000) OR set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS

Update a java thread's stack size at runtime

纵饮孤独 提交于 2019-12-01 10:39:10
Does anyone know if there is a way to dynamically (runtime) increase the stack size of the main Thread? Also, and I believe it is the same question, is it possible to increase / update the stack size of a Thread after its instantiation? Thread ’s CTOR allows the definition of its stack size but I can’t find any way to update it. Actually, I didn’t find any management of the stack size in the JDK (which tends to indicate that it’s not possible), everything is done in the VM. According to the java language specification it is possible to set the stack size ‘when stack is created’ but there is a

Cmake change stack size

﹥>﹥吖頭↗ 提交于 2019-12-01 08:42:00
问题 Is there a way to change stack size from the Cmake ? I only found one forum thread mentioning CMAKE_CXX_STACK_SIZE but I couldn't find the documentation for this command. Ideally the command should work for both Visual Studio C++ and gcc . 回答1: I don't have VS at the moment, but the following three CMake commands all work for me on MinGW/GCC (replace <target> with what you entered into add_executable() ): target_link_libraries(<target> PRIVATE "-Wl,--stack,10000000") OR set_target_properties(

Update a java thread's stack size at runtime

笑着哭i 提交于 2019-12-01 06:40:48
问题 Does anyone know if there is a way to dynamically (runtime) increase the stack size of the main Thread? Also, and I believe it is the same question, is it possible to increase / update the stack size of a Thread after its instantiation? Thread ’s CTOR allows the definition of its stack size but I can’t find any way to update it. Actually, I didn’t find any management of the stack size in the JDK (which tends to indicate that it’s not possible), everything is done in the VM. According to the

thread stack size on Windows (Visual C++)

可紊 提交于 2019-11-30 08:22:22
问题 Is there a call to determine the stack size of a running thread? I've been looking in MSDN thread functions documentation, and can't seem to find one. 回答1: Whilst there isn't an API to find out stack size directly, contiguous virtual address space must be reserved up to the maximum stack size - it's just that a lot of that space isn't committed yet. You can take advantage of this and make two calls to VirtualQuery. For the first call, pass it the address of any value on the stack to get the

How to determine Stack size of a Program in linux?

耗尽温柔 提交于 2019-11-29 10:45:31
How does one determine the current stack size of a program in linux? it is said that the stack size of each program will be 8 MB in linux but when you use cat /proc//mmap it shows a different size. Also, how does one determine stack size of associated threads? Since it is said that threads have their own private stack? If you simply want the current stack size, you could declare a variable at the top of main(), take its address, and compare it to the address of a variable declared at wherever you define "current" to be. The difference should be the approximate size that the stack has grown. If