heap-memory

invalid conversion from *void to *int [-fpermissive] using malloc(sizeof())

与世无争的帅哥 提交于 2019-12-18 05:26:13
问题 I'm writing a program that calculates the greatest common denominator of two numbers, but i'm getting problem with malloc function and pointers. Actually it's clear how the stack and the heap segments work in the memory and why. But yet i'm not yet able to understand when declaring a pointer and using malloc is functional or not, is necessary or not, in a program. here is the code : #include <iostream> #include <stdlib.h> #include <stdio.h> int *calcolaDivisori(int); int main(int argc, char**

Immediate detection of heap corruption errors on Windows. How?

ぐ巨炮叔叔 提交于 2019-12-18 03:57:17
问题 I can't sleep! :) I have a reasonably large project on Windows and encountered some heap corruption issues. I have read all SO, including this nice topic: How to debug heap corruption errors?, however nothing was suitable to help me out-of-the-box. Debug CRT and BoundsChecker detected heap corruptions, but addresses were always different and detections point were always far away from the actual memory overwrites. I have not slept till the middle of the night and crafted the following hack:

Can't change tomcat 7 heap size

大城市里の小女人 提交于 2019-12-17 22:34:34
问题 I have set the heap size of tomcat 7 by adding the following line in catalina.sh export CATALINA_OPTS="-Xms512m -Xmx1024m" then stopped and started the tomcat. but when tried to get the heap size using the command jmap -heap , i can notice that the memory doesn't change: Heap Configuration: MinHeapFreeRatio = 40 MaxHeapFreeRatio = 70 MaxHeapSize = 526385152 (502.0MB) NewSize = 1048576 (1.0MB) MaxNewSize = 4294901760 (4095.9375MB) OldSize = 4194304 (4.0MB) NewRatio = 2 SurvivorRatio = 8

Good introductory text about GHC implementation?

我的未来我决定 提交于 2019-12-17 21:25:09
问题 When programming in Haskell (and especially when solving Project Euler problems, where suboptimal solutions tend to stress the CPU or memory needs) I'm often puzzled why the program behaves the way it is. I look at profiles, try to introduce some strictness, chose another data structure, ... but mostly it's groping in the dark, because I lack a good intuition. Also, while I know how Lisp, Prolog and imperative languages are typically implemented, I have no idea about implementing a lazy

How can I take a heap dump on Java 5 without garbage collecting first?

会有一股神秘感。 提交于 2019-12-17 19:49:32
问题 We have a long running server application running Java 5, and profiling it we can see the old generation growing slowly over time. It's correctly freed on a full GC, but I'd like to be able to look at the unreachable objects in Eclipse MAT using a heap dump. I've successfully obtained a heap dump using +XX:HeapDumpOnCtrlBreak, but the JVM always does a GC before dumping the heap. Apparently this doesn't happen on Java 6 but we're stuck on 5 for now. Is there any way to prevent this? 回答1: I

How to set Java heap size (Xms/Xmx) inside Docker container?

試著忘記壹切 提交于 2019-12-17 18:13:26
问题 As of raising this question, Docker looks to be new enough to not have answers to this question on the net. The only place I found is this article in which the author is saying it is hard, and that's it. 回答1: I agree that it depends on what container you're using. If you are using the official Tomcat image, it looks like it's simple enough, you will need to pass the JAVA_OPTS environment variable with your heap settings: docker run --rm -e JAVA_OPTS='-Xmx1g' tomcat See How to set JVM

How to increase Java heap space for a tomcat app

浪尽此生 提交于 2019-12-17 18:06:59
问题 There are lots of questions that ask this or a similar question. They all give the command that has to be executed, what I don't understand is where do I write this command. I want to permanently increase the heap space for my tomcat apps. I read this page http://javahowto.blogspot.com/2006/06/6-common-errors-in-setting-java-heap.html and it says under the Tomcat section Stop Tomcat server, set environment variable CATALINA_OPTS, and then restart Tomcat. Look at the file tomcat-install/bin

How to increase Java heap space for a tomcat app

笑着哭i 提交于 2019-12-17 18:05:25
问题 There are lots of questions that ask this or a similar question. They all give the command that has to be executed, what I don't understand is where do I write this command. I want to permanently increase the heap space for my tomcat apps. I read this page http://javahowto.blogspot.com/2006/06/6-common-errors-in-setting-java-heap.html and it says under the Tomcat section Stop Tomcat server, set environment variable CATALINA_OPTS, and then restart Tomcat. Look at the file tomcat-install/bin

how to increase java heap memory permanently?

喜欢而已 提交于 2019-12-17 10:44:58
问题 I have one problem with java heap memory. I developed one client server application in java which is run as a windows service it requires more than 512MB of memory. I have 2GB of RAM but when I run my application it throws an exception Out of memory error:java heap space but I have already set heap size (maximum 512MB) in the java control panel and I still get the same error. I can't set heap size through the command line because my application runs as a windows service so how can I increase

Visual Studio - how to find source of heap corruption errors

做~自己de王妃 提交于 2019-12-17 10:11:58
问题 I wonder if there is a good way to find the source code that causes a heap corruption error, given the memory address of the data that was written 'outside' the allocated heap block in Visual Studio; Dedicated (0008) free list element 26F7F670 is wrong size (dead) (Trying to write down some notes on how to find memory errors) Thanks in advance! 回答1: Begin with installing windbg: http://www.microsoft.com/whdc/Devtools/Debugging/default.mspx Then turn on the pageheap like this: gflags.exe –p