heap-memory

C++ delete does not free all memory (Windows)

情到浓时终转凉″ 提交于 2019-11-27 14:30:48
I need help understanding problems with my memory allocation and deallocation on Windows. I'm using VS11 compiler (VS2012 IDE) with latest update at the moment (Update 3 RC). Problem is: I'm allocating dynamically some memory for a 2-dimensional array and immediately deallocating it. Still, before memory allocation, my process memory usage is 0,3 MB before allocation, on allocation 259,6 MB (expected since 32768 arrays of 64 bit ints (8bytes) are allocated), 4106,8 MB during allocation, but after deallocation memory does not drop to expected 0,3 MB, but is stuck at 12,7 MB . Since I'm

PySpark: java.lang.OutofMemoryError: Java heap space

怎甘沉沦 提交于 2019-11-27 13:54:25
I have been using PySpark with Ipython lately on my server with 24 CPUs and 32GB RAM. Its running only on one machine. In my process, I want to collect huge amount of data as is give in below code: train_dataRDD = (train.map(lambda x:getTagsAndText(x)) .filter(lambda x:x[-1]!=[]) .flatMap(lambda (x,text,tags): [(tag,(x,text)) for tag in tags]) .groupByKey() .mapValues(list)) When I do training_data = train_dataRDD.collectAsMap() It gives me outOfMemory Error. Java heap Space . Also, I can not perform any operations on Spark after this error as it looses connection with Java. It gives

Java out of heap space during serialization

孤者浪人 提交于 2019-11-27 12:57:51
问题 The following code is causing a OutOfMemmoryError: heap space for some 3 million rows. Memory allocated to JVM is 4 GB, using 64 bit installation. while (rs.next()) { ArrayList<String> arrayList = new ArrayList<String>(); for (int i = 1; i <= columnCount; i++) { arrayList.add(rs.getString(i)); } objOS.writeObject(arrayList); } The memory referenced by the ArrayList is eligible for garbage collection in each iteration of the while loop, and internally JVM calls garbage collection ( System.gc()

how to increase java heap memory permanently?

强颜欢笑 提交于 2019-11-27 12:46:09
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 the default heap size? Please note that increasing the Java heap size following an java.lang

Tomcat 7: How to set initial heap size correctly?

非 Y 不嫁゛ 提交于 2019-11-27 11:52:24
I was trying to adjust initial heap size of a tomcat 7 (CentOS, java -version: 1.6.0_25-b06) instance by adding the following line to catalina.sh: export CATALINA_OPTS="-Xms=512M -Xmx=1024M" Starting up tomcat fails and logs the following message to catalina.out: Invalid initial heap size: -Xms=512m Could not create the Java virtual machine. What is wrong with these options? You must not use = . Simply use this: export CATALINA_OPTS="-Xms512M -Xmx1024M" Use following command to increase java heap size for tomcat7 (linux distributions) correctly: echo 'export CATALINA_OPTS="-Xms512M -Xmx1024M"'

Where are instance variables of an Object stored in the JVM?

一笑奈何 提交于 2019-11-27 11:44:18
问题 Is an instance variable of an object in Java stored on the stack or method area of the JVM? Also, do we have different instance variable for multiple threads? If it is stored in method area how is instance variable different from static variable storage? 回答1: Stack and heap are the memories allocated by the OS to the JVM that runs in the system. Stack is a memory place where the methods and the local variables are stored. (variable references either primitive or object references are also

Visual Studio - how to find source of heap corruption errors

試著忘記壹切 提交于 2019-11-27 10:24:01
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! Begin with installing windbg: http://www.microsoft.com/whdc/Devtools/Debugging/default.mspx Then turn on the pageheap like this: gflags.exe –p /enable yourexecutable.exe /full This will insert a non writable page after each heap allocation. After this

Will OpenJDK JVM ever give heap memory back to Linux?

余生长醉 提交于 2019-11-27 09:57:07
问题 We have a long-lived server process, that infrequently needs a lot of RAM for a short while. We see that once the JVM has gotten the memory from the OS, it never returns it back to the OS. How do we ask the JVM to return heap memory back to the OS? Typically, the accepted answer to such questions is to use -XX:MaxHeapFreeRatio and -XX:MinHeapFreeRatio . (See e.g. 1,2,3,4). But we're running java like this: java -Xmx4G -XX:MaxHeapFreeRatio=50 -XX:MinHeapFreeRatio=30 MemoryUsage and still see

Stack vs heap allocation of structs in Go, and how they relate to garbage collection

我是研究僧i 提交于 2019-11-27 09:08:47
问题 I'm new to Go and I'm experiencing a bit of congitive dissonance between C-style stack-based programming where automatic variables live on the stack and allocated memory lives on the heap and and Python-style stack-based-programming where the only thing that lives on the stack are references/pointers to objects on the heap. As far as I can tell, the two following functions give the same output: func myFunction() (*MyStructType, error) { var chunk *MyStructType = new(HeaderChunk) ... return

How to fix “Requested array size exceeds VM limit” error in Java?

女生的网名这么多〃 提交于 2019-11-27 09:03:26
Is there an log option that can let tomcat log the bad query instead just throwing this ? SEVERE: java.lang.OutOfMemoryError: Requested array size exceeds VM limit (Tried log level to FULL, but only capture the above) This is not enough information to further debug Alternatively, if this can be fixed by allocated more memory by tweaking the following? -Xms1024M -Xmx4096M -XX:MaxPermSize=256M Update -Xms6G -Xmx6G -XX:MaxPermSize=1G -XX:PermSize=512M (the above seems works better, keep monitoring) I suspect you might be using sorts on a large index. That's one thing I definitely know can require