garbage-collection

Java garbage collect to hashtable

為{幸葍}努か 提交于 2019-12-24 07:04:16
问题 Does java collect the garbage-signed things as objects? If yes, can i tell java to direct them to one of my hashtables(accepts objects right?) programmatically? I am curious about this functionality.I know System.gc() is the command but how can i achieve first question? Can i? myTrashBin=System.gc().getObjectList(); //??? If not, may be there could be a way to create this functionality by custom classes. Last question: how can we override System.gc() ? Thanks. 回答1: This isn't under your

Spark Job error GC overhead limit exceeded [duplicate]

假如想象 提交于 2019-12-24 06:11:33
问题 This question already has answers here : Error java.lang.OutOfMemoryError: GC overhead limit exceeded (19 answers) Closed 3 years ago . I am running a spark job and I am setting the following configurations in the spark-defaults.sh. I have the following changes in the name node. I have 1 data node. And I am working on data of 2GB. spark.master spark://master:7077 spark.executor.memory 5g spark.eventLog.enabled true spark.eventLog.dir hdfs://namenode:8021/directory spark.serializer org.apache

Garbage Collector, call & callvirt and Debug/Release code mode execution differences

独自空忆成欢 提交于 2019-12-24 03:52:07
问题 I have a class: public class SomeClass { public int I; public SomeClass(int input) { I = input; Console.WriteLine("I = {0}", I); } ~SomeClass() { Console.WriteLine("deleted"); } public void Foo() { Thread.Sleep(1000); Console.WriteLine("Foo"); } } and this program: class Program { static void Main(string[] args) { new Thread(() => { Thread.Sleep(100); GC.Collect(); }) { IsBackground = true }.Start(); new SomeClass(10).Foo(); // The same as upper code // var t = new SomeClass(10); // t.Foo();

Cassandra GC takes 30 seconds and hangs node

[亡魂溺海] 提交于 2019-12-24 02:23:38
问题 Environment I have a following environment: Cassandra 2.1.0 5 nodes in one DC, 4 nodes in second DC 2500 writes per seconds minimal reads (usually none, sometimes few) Problem After a long running node, GC starts to take longer and longer, until the nodetool reports this node as down. I visualize gc.log and have a following screenshot: JVM settings After comment the full command line of working Cassandra is: java -ea -javaagent:/usr/lib/cassandra/bin/../lib/jamm-0.2.6.jar -XX:

Flex memory limit - how to configure

杀马特。学长 韩版系。学妹 提交于 2019-12-24 01:36:37
问题 Can I control the memory limit (i.e. when GC has to run) in my Flex application? 回答1: I don't think so. That is probably a parameter of the flash player based at the client, and I assume it is also dependant on the exact resources the client machine has, i.e. more RAM means less frequent gc, etc. 回答2: Check out the flash.system.System class. The "totalMemory" property will show you (in bytes) how much memory the current application is using. Calling System.gc() will run a GC. You could use a

Memory not getting freed up in Asp.Net core api

三世轮回 提交于 2019-12-24 01:24:32
问题 I have an issue where the memory is not getting freed up in my .NET Core Web API. All I am doing is simply returning a string from a static class. API: [HttpGet] public string Get() { return A.get(); } public static class A { public static string get() { return "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; } } Client: HttpClient hc = new HttpClient(); for(int i=0;i<100000;i++) { //var v = hc.GetAsync("http:/

How to efficiently manage memory/time in C++?

筅森魡賤 提交于 2019-12-24 01:20:10
问题 The case: I wrote a minimax algorithm in Java, then I ported the code in C++, mantaining the same classes and methods. Then I valgrinded the C++ code until all memory leaks were fixed by putting delete functions in destructors (when possible). When all leaks were fixed, I tested the algorithm on a tic-tac-toe game, which code was then ported identically in C++. I was sure that the C++ version would have been more performant, however I was surprised seeing that 100 (not random) instances of

Is the network load balancer of a web farm affected by GC strain?

限于喜欢 提交于 2019-12-24 01:17:36
问题 Can the resources of one machine in a web farm be affected to such a point by an app running with Garbage Collection Mode = "server mode" such that the network load balancer will adjust for it? 回答1: Network load balancer is not "sensitive" to GC, in a sense it doesn't know when or where it happens. It may attempt to do some funky stuff with checking the "load" on the machine, but usually it hurts performance and a simple round robin turns out to be better a approach for most of the scenarios.

Which JVM Flag sets the GC overhead threshold mentioned in the G1Ergonomics log?

你说的曾经没有我的故事 提交于 2019-12-24 01:16:46
问题 I'm using the G1 garbage collector. You can enable adaptive size policy logs with -XX:+PrintAdaptiveSizePolicy Here's sample output in the GC logs 1822.780: [G1Ergonomics (Heap Sizing) attempt heap expansion, reason: recent GC overhead higher than threshold after GC, recent GC overhead: 11.48 %, threshold: 10.00 %, uncommitted: 0 bytes, calculated expansion amount: 0 bytes (20.00 %)] Which JVM flag manages the threshold: 10.00 % that is mentioned in there? Below are some of the flags that

Is it possible to change Garbage Collection behavior in Java ME?

别说谁变了你拦得住时间么 提交于 2019-12-24 01:03:40
问题 I was wondering if it is possible to tweak the way garbage collector works on JavaMe in order to improve performance somehow(may reducing the number of passages)? I´ve seen some articles about it, but mostly directed Java SE and most of them says GC is highly dependant on the maker. How much would that be. 回答1: When the garbage collector is triggered is largely a mistery unless you have first hand knowledge of how the particular VM your application is running on was implemented and exactly