hi i am developing application with 20 UIViewControllers. application working fine but when tracking memory allocations in the instruments All allocations(Live bytes) showing bellow 10 MB .but it producing low memory warning alert like bellow.
i can't understand what the problem is
can any one help me to get me out of this issue
Please check if view controller as a delegate to anything such as a text field or other control? If so, this will prevent the view controller from being released from memory due to a circular dependency.
Related
Whenever I try to update Android Studio I keep getting the same error. In the past I've had to manually uninstall/download the new build but it's annoying have to do that all the time especially for small updates (minor versions) like this one. Please see attached screenshots to see the problem I'm having
I'm on OSX 10.14.6 Mojave. Everything else is up-to-date. I can see that I'm not running low on free memory either.
Anyone have any idea what's going on? Thanks
Java heap size is set at VM creation time, and has nothing to do with the physical memory available, i. e. it doesn't grow as needed until there's no more virtual memory, the way a native program's heap would.
Go to Help/Change memory settings, and increase the heap size as you see fit.
I'm investigating a memory leak in my nodejs script, by checking process.memoryUsage().heapUsed, the usage is around 3000MB.
chrome://inspect also shows memory usage of around 3000MB. However, every time after I take a heap snapshot, the heap snapshot saved reduced to around 73 MB, process.memoryUsage().heapUsed also reduced to that figure.
Anyone has a theory on how is this happening?
It sounds like the garbage collector is running after you check the usage. Basically every once in awhile it will check to see if there is anything that isn't tied to anything anymore and will remove it, freeing up space. See this article for more details:
https://blog.sessionstack.com/how-javascript-works-memory-management-how-to-handle-4-common-memory-leaks-3f28b94cfbec
My project has started using java 8 from java 7.
After switching to java 8, we are seeing issues like the memory consumed is getting higher with time.
Here are the investigations that we have done :
Issues comes only after migrating from java7 and from java8
As metaspace is the only thing related to memory which is changes from hava 7 to java 8. We monitored metaspace and this does not grow more then 20 MB.
Heap also remains consistent.
Now the only path left is to analyze how the memory gets distributes to process in java 7 and java 8, specifically private byte memory. Any thoughts or links here would be appreciated.
NOTE: this javaw application is a swing based application.
UPDATE 1 : After analyzing the native memory with NMT tool and generated a diff of memory occupied as compare to baseline. We found that the heap remained same but threads are leaking all this memory. So as no change in Heap, I am assuming that this leak is because of native code.
So challenge remains still open. Any thoughts on how to analyze the memory occupied by all the threads will be helpful here.
Below are the snapshots taken from native memory tracking.
In this pic, you can see that 88 MB got increased in threads. Where arena and resource handle count had increased a lot.
in this picture you can see that 73 MB had increased in this Malloc. But no method name is shown here.
So please throw some info in understanding these 2 screenshot.
You may try another GC implementation like G1 introduced in Java 7 and probably the default GC in Java 9. To do so just launch your Java apps with:
-XX:+UseG1GC
There's also an interesting functionality with G1 GC in Java 8u20 that can look for duplicated Strings in the heap and "deduplicate" them (this only works if you activate G1, not with the default Java 8's GC).
-XX:+UseStringDeduplication
Be aware to test thoroughly your system before going to production with such a change!!!
Here you can find a nice description of the diferent GCs you can use
I encountered the exact same issue.
Heap usage constant, only metaspace increase, NMT diffs showed a slow but steady leak in the memory used by threads specifically in the arena allocation. I had tried to fix it by setting the MALLOC_ARENAS_MAX=1 env var but that was not fruitful. Profiling native memory allocation with jemalloc/jeprof showed no leakage that could be attributed to client code, pointing instead to a JDK issue as the only smoking gun there was the memory leak due to malloc calls which, in theory, should be from JVM code.
Like you, I found that upgrading the JDK fixed the problem. The reason I am posting an answer here is because I know the reason it fixes the issue - it's a JDK bug that was fixed in JDK8 u152: https://bugs.openjdk.java.net/browse/JDK-8164293
The bug report mentions Class/malloc increase, not Thread/arena, but a bit further down one of the comments clarifies that the bug reproduction clearly shows increase in Thread/arena.
consider optimising the JVM options
Parallel Collector(throughput collector)
-XX:+UseParallelGC
concurrent collectors (low-latency collectors)
-XX:+UseConcMarkSweepGC
use String Duplicates remover
-XX:+UseStringDeduplication
optimise compact ratio
-XXcompactRatio:
and refer
link1
link2
In this my answer you can see information and references how to profile native memory of JVM to find memory leaks. Shortly, see this.
UPDATE
Did you use -XX:NativeMemoryTracking=detail option? The results are straightforward, they show that the most memory allocated by malloc. :) It's a little bit obviously. Your next step is to profile your application. To analyze native methods and Java I use (and we use on production) flame graphs with perf_events. Look at this blog post for a good start.
Note, that your memory increased for threads, likely your threads grow in application. Before perf I recommend analyze thread dumps before/after to check does Java threads number grow and why. Thread dumps you can get with jstack/jvisualvm/jmc, etc.
This issue does not come with Java 8 update 152. The exact root cause of why it was coming with earlier versions is still not clearly identified.
I am having an issue where w3wp.exe is gaining around 100 meg per page load on a specific page (not entire site). The page is not that memory intensive and should not require so much memory.
I modified a single setting, "Enable 32-bit Applications" and set it to true and now the leak is gone, however I need to understand why this might be happening. It is happening only on one server, the other servers we test on do not see this issue. When Enable 32-bit Applications is disabled (false), the results from the ANTS memory profiler are attached below. Does anyone have any idea what's going on? Please note the only thing growing is "Unused Memory" / "Free Space"
Can you go into the list of classes and sort by the memory occupied?
I was too quick to judge this. After I disabled most of the work that one page was doing, the growth stopped, but looking at other pages I saw a similar pattern, but it stopped at a lower memory limit, like say 450 meg. then I upped our private memory limit to 2 gig instead of 1 gig, and re-enabled the "leaking" code. The memory shot up to 1.05 gig in 3 refreshes. 20 refreshes later, it is not significantly changing.
This is a case of IIS 64 bit app pool allocating way more memory than is necessary. Since it isn't actually leaking, this question was invalid.
anyway, if you notice the same behavior with Enable 32-bit Applications, I hope this helps you
I have memory and CPU intensive application which runs several hundred concurrent threads that do text processing. There is a lot of going on in background, processing files, logging to disk, and so on. Application is compiled for x64 platform, under XE2.
Occassionaly, it crashes, and I've been trying to debug this issue for a few days, but without success. Here is the bug report: http://pastebin.com/raw.php?i=sSUXCznT
I tried running it under debugger and it reports Out of Memory exception after a while. At the point of crash, it was using 670mb of RAM, and machine has 32gb total RAM.
I was thinking it may be fragmentation, but if I'm understanding this bug report correctly, it says largest free block : 8185.75 GB, which indicates that fragmentation isn't the issue here.
Application isn't leaking memory anywhere (atleast that I know of), I have ReportMemoryLeaksOnShutdown enabled and it works fine.
Since I don't have any other ideas why it would crash with Out of memory exception, I would like to get some hints so I can get on the right path to fix this.
Try setting a breakpoint in System.pas procedure Error(errorCode: TRuntimeError);. Your Application should stop there when the out of memory happens. When you get there, skip the ErrorAt function (by using Debug->"Set next statement" in the context menu). That will silently ignore the exception so you can debug the call stack easier. Leave the functions with F7 until you have a useful stack trace.