heap-memory

How to increase the heap size of the google cloud app engine?

别来无恙 提交于 2019-11-29 13:04:57
I am now using Google Cloud App Engine Standard environment for Java application and I am getting outOfMemory Error cause the Java heap size` is quite filled. I know why cause I'm processing a lot of data which might reach 1GB, so how to increase the heap size allocated for a java app running in App Engine Standard environment. I've fixed my problem by moving to java8 and now Im using java 8 environmental variables to increase the java heap size by adding this to the appengine-web.xml <env-variables> <env-var name="GAE_MEMORY_MB" value="1024M" /> <env-var name="HEAP_SIZE_RATIO" value="90" /> <

Java memory areas in java 8

梦想的初衷 提交于 2019-11-29 12:02:25
I have read a lot about java memory areas, but looks like it is just a mess. Mostly due to the introduction of a new MetaSpace area instead of PermGen in java8. And there are questions now: What areas does the heap include in java8+ ? Where the static methods and variables are stored before java8 and java8+ ? Does the MetaSpace store anything except class meta-data info ? Does the structure of memory areas depend on the implementation of JVM ? Thank you for your answers. Does the structure of memory areas depend on the implementation of JVM ? Absolutely. PermGen or Metaspace are just

out of memory error, java heap space

允我心安 提交于 2019-11-29 10:54:25
I try to read log file with more than 4 million lines and size more than 400 MB, but I get Out of Memory Error : java heap space . This is my code : File file = new File("C:\\file.log"); FileReader fileReader = new FileReader(file); BufferedReader bufferedReader = new BufferedReader(fileReader); StringBuilder stringBuffer = new StringBuilder(); String line; while ((line = bufferedReader.readLine()) != null) { stringBuffer.append(line); } I tried to increase heap memory to 1GB, but still get that message. What would be the possible cause? Ok, you already should have a clue, reading the comments

Thread-specific heap allocation

浪子不回头ぞ 提交于 2019-11-29 10:18:35
Is it possible to make some sub-set of threads (e.g. from specific ThreadPool) allocate memory from own heap? E.g. most of the threads are allocating from regular shared heap, and few worker threads are allocating from individual heaps (1:1 per thread). The intent is to ensure safe execution of the code in shared environment - typical worker is stateless and is running on separate thread, processing of one request should not consume more than 4MB of heap. Update #1 Re: But why are you worried about "safe execution" and unpredictable increasing of heap consumption? The point is about safe

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

痞子三分冷 提交于 2019-11-29 08:58:42
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** argv) { int foundCounter = 0; int i,j,s1,s2; int n1,n2; int mcd = 1,mcm; int *pn1,*pn2; int d1[100],d2

Heap Memory in C Programming

吃可爱长大的小学妹 提交于 2019-11-29 08:45:53
What exactly is heap memory? Whenever a call to malloc is made, memory is assigned from something called as heap. Where exactly is heap. I know that a program in main memory is divided into instruction segment where program statements are presents, Data segment where global data resides and stack segment where local variables and corresponding function parameters are stored. Now, what about heap? collin The heap is part of your process's address space. The heap can be grown or shrunk; you manipulate it by calling brk(2) or sbrk(2) . This is in fact what malloc(3) does. Allocating from the heap

How much memory do golang maps reserve?

ぐ巨炮叔叔 提交于 2019-11-29 04:52:14
Given a map allocation where the initial space is not specified, for example: foo := make(map[string]int) The documentation suggests that the memory allocation here is implementation dependent. So (how) can I tell how much memory my implementation is allocating to this map? You may use the Go testing tool to measure size of arbitrary complex data structures. This is detailed in this answer: How to get variable memory size of variable in golang? To measure the size of a map created by make(map[string]int) , use the following benchmark function: var x map[string]int func BenchmarkEmptyMap(b

Immediate detection of heap corruption errors on Windows. How?

非 Y 不嫁゛ 提交于 2019-11-29 03:36:31
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: DWORD PageSize = 0; inline void SetPageSize() { if ( !PageSize ) { SYSTEM_INFO sysInfo; GetSystemInfo(

How to avoid MATLAB crash when opening too many figures?

痴心易碎 提交于 2019-11-29 03:30:34
Sometimes I start a MATLAB script and realize too late that it is going to output way too many figures. Eventually I get an Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space which can easily be reproduced on my machine using for i=1:inf figure; end I get to around ~90 figures before it crashes with the standard setting ( Preferences / Java Heap Memory ) of 128 MB Java heap, while doubling the Heap to 256 MB gives me around 200 figures. Do you see any way to avoid the Java error message? If there is not enough memory for another figure, I'd like my script to be

What is the difference between Java Non Heap Memory and Stack Memory? Are they Same if not what is the difference between them?

橙三吉。 提交于 2019-11-29 02:45:27
问题 I am using Jconsole for monitoring a Java Application. The memory tab shows different Heap and Non Heap memories like Heap Memory Usage Non Heap Memory Usage Memory Pool "CMS Old Gen" Memory Pool "Par Eden Space" Memory Pool "Par Survivor Space" Memory Pool "Code Cache" Memory Pool "CMS Perm Gen" What is the difference between these terms. Also please provide some information regarding - how to find anomalies in the application behavior by monitoring these parameters. 回答1: There are