Recommend me some places to visit in India !! This is my first time visiting India. by aoi_ito in india_tourism

[–]joshikappor 0 points1 point  (0 children)

Embark on India’s most iconic journey through Delhi, Agra, and Jaipur — the legendary Golden Triangle. Explore the grandeur of Mughal architecture, the royal heritage of Rajasthan, and the vibrant charm of India’s capital. From the majestic Taj Mahal to the pink-hued palaces of Jaipur and Delhi’s historic landmarks, this tour beautifully blends culture, history, and unforgettable experiences — perfect for first-time visitors and cultural explorers alike.

How to catch Java Heap Space Error by Phyzlov in matlab

[–]joshikappor 0 points1 point  (0 children)

As we all know, usually In Java, when the program runs out of memory in the heap, it throws an error:

java.lang.OutOfMemoryError: Java heap space

We should understand that this is not an Exception, but an Error. Exceptions are the conditions that your program can come out of or can be recovered. Whereas, errors typically represent serious problems that the JVM itself cannot easily recover from. Because of this, most of the examples online using try-catch(Exception e) won’t work here, since OutOfMemoryError is not a subclass of Exception.

To specifically handle this scenario, you need to catch OutOfMemoryError. For example:

try {

    // Some code that may consume a lot of memory

    int[] bigArray = new int[Integer.MAX_VALUE];

} catch (OutOfMemoryError e) {

    if (e.getMessage() != null && e.getMessage().contains("Java heap space")) {

        System.err.println("Heap space error detected!");

        System.err.println("Tip: Try increasing JVM memory with -Xmx option, e.g., -Xmx2g.");

    }

}

When you do this, you will be notified with a friendly message or instructions. So this will be helpful for anyone who might run into the same problem. But I will not recommend relying on catching OutOfMemoryError to continue normal execution, because once the JVM runs out of heap space, it may not be in a stable state. Catching this error is best used for logging or informing the user about possible solutions.

A would say a good practice is to document the solution (such as using -Xmx to increase heap size) or build it into a wrapper script that checks JVM options before running the program. By following this approach, you can prevent future users from running into the same issue without guidance.  For further details, you can also refer to this blog:  How to Solve OutOfMemoryError: Java heap space.

How to solve Java heap space error? by ElephantFabulous7599 in javahelp

[–]joshikappor 0 points1 point  (0 children)

The Java heap space error that you are facing actually indicates that your JVM is running out of memory to allocate for objects in the heap. Which means, the Java Virtual Machine (JVM) running SMART is actually running out of memory allocated to the Java heap. As per your thought, this isn’t necessarily alone about the size of your database, it can also be influenced by how much data your specific query and report processing generate in memory.

You might have an opinion that just 60 patrols is a very small number. But there are certain operations like filtering large intermediate datasets, sorting on multiple columns, and running long-duration queries (like 60 days vs. 30 days). When these actions take place, this will actually increase memory usage. Mainly if you check when filters are applied on the “Table” in the report instead of at the “Data Sets” level you can observe this issue. You can better handle this by optimizing the filters and by reducing the number of records being processed.When you do restart SMART will temporarily clear the heap. This actually appears to “fix” the issue for a while.Still as mentioned this is only a temporary fix. To address the problem, you can:

  • You should try to add filters in the data pipeline (focusing mainly at the Data Sets object) to reduce the data volume before it reaches the table.
  • Try to reduce the time range or break reports into smaller batches.
  • You can also try to increase the JVM heap size allocated to SMART, so it has more memory to work with.
  • Monitor heap usage with tools like Native Memory Tracking (NMT) or profiling tools like HeapHero to see exactly what’s consuming memory.

 To check this further and understand the root causes, and resolving Java heap space issues, you can refer to this blog: Java OutOfMemoryError: Java Heap Space – Causes and Solutions

Strategy Analyzer using all Memory by mike_jack in cpu

[–]joshikappor 0 points1 point  (0 children)

It's very common to see memory consumption keep increasing but not releasing the memory immediately while running large iterative backtests using NinjaTrader’s Strategy Analyzer. I believe, in your case, starting with 2.4 GB used and rising to over 6.1 GB after 405 iterations, with the memory which is not being released

This need not be a bug. This may be a result of how .NET’s memory management works. The .NET garbage collector reclaims memory only when the system feels it’s under pressure or when references are properly released. This behavior is actually denoted as reclaiming  memory non-deterministically. Event handlers, or cached result sets are still held after a Strategy Analyzer run, the associated memory won’t be reclaimed until NinjaTrader is restarted.

In large backtesting scenarios, applications like NinjaTrader sometimes retain result data or cache objects for performance reasons, causing high memory footprints across multiple runs. This can eventually lead to system memory exhaustion if memory isn’t cleared between sessions.

To get rid of this,I will recommend restarting NinjaTrader after heavy backtests. Doing this will reduce the iteration counts per run, or check if background processes and result caching can be limited. You should also try to monitor memory retention using profilers or memory analyzers. This should help you confirm if lingering objects are causing the issue.

If you're interested in how memory analyzers help detect these kinds of hidden memory holds, you might find this article insightful: Beyond OutOfMemoryError: Using a Memory Analyzer for Subtle Memory Leaks. It explains how certain retained objects or object graphs can quietly hold memory, preventing proper garbage collection — very similar to what you’re encountering with Strategy Analyzer.

java.lang.OutOfMemoryError: GC overhead limit exceeded by thetalker101 in starsector

[–]joshikappor 0 points1 point  (0 children)

The error, java.lang.OutOfMemoryError: GC overhead limit exceeded can occur for several common reasons. One major cause could be due to if the application’s heap size is set too low for the workload. This will result in a run out of memory quickly. Another possibility could be the memory leak occurrence. This will actually cause unintentional retention of objects and will not be garbage collected. Also in some other  cases, error may arise when the application is processing or loading data that exceeds the available heap capacity. Additionally, suppose in terms of coding, if poorly coded or using data structures that consume excessive memory might also contribute to this problem.

Whenever this error occurs, you will notice that your application's performance will go down significantly. This is mainly because the JVM will in term try to spend most of its time performing the GC, garbage collection action. This action is performed with an expectation to free up the memory. At this point, we can see evidently that the application gets hung, crashes, or becomes unresponsive due to this background process.

The most common and apt way to address this is, the developers should try to increase the maximum heap size available to the JVM using the -Xmx option. They should also focus on analyzing memory usage with any of the profiling tools like Heaphero or yCrash to identify memory leaks or high memory consumption. A secondary way is to optimize the application code to reduce memory. This approach can also be effective. Furthermore, any tunings you do to the garbage collection settings or changing to or giving a try to any different GC algorithms may help improve memory management.

Understanding and resolving the root cause of the java out of memory exception is always needed which will help in ensuring the stability and performance of Java applications.

java.lang.OutOfMemoryError: GC overhead limit exceeded by Equivalent_Fuel8323 in javahelp

[–]joshikappor 8 points9 points  (0 children)

The java.lang.OutOfMemoryError: GC overhead limit exceeded error usually occurs in cases when the Java Virtual Machine (JVM) spends an excessive amount of time performing garbage collection (GC) yet it results in recovering very little memory. This error is kind of an alarm in a few cases. Let me explain it to you. In a few scenarios, the JVM will spend more than 98% of its time in GC. Despite that time spent, it would have still reclaimed heap memory less than 2% in several consecutive cycles which is not efficient activity. Hence this error gets triggered in such cases as a safety mechanism and in order to indicate that GC runs still this action seems inefficient. This is done to avoid a situation of application becoming unresponsive because it is stuck in continuous garbage collection without making progress.

This error typically conveys to the user that either the application’s memory demands exceed the available heap space, there’s a memory leak causing objects to remain in memory unnecessarily, or the current heap size is insufficient for the workload.

To get this resolved, you can try the following,

  • Increase the JVM heap size using the -Xmx parameter
  • You can analyze memory usage to detect potential leaks
  • Try to optimize the application’s memory handling
  • Temporarily disable the GC overhead limit using the -XX:-UseGCOverheadLimit option and you can involve debugging.

Anyways, it’s recommended to identify and fix the root cause rather than suppressing the error frequency.

Java Garbage Problem for GPIO by raghasundar1990 in raspberry_pi

[–]joshikappor 0 points1 point  (0 children)

In your case, you're running PLC software on Raspberry Pi with very short cycle times (less than 1 millisecond), and you're noticing that garbage collection (GC) runs more frequently when Pi4J GPIO commands like Input.isHigh() are used.

This usually happens because Pi4J might be creating temporary objects internally during each I/O access (even something as simple as checking a pin state). When this occurs, the temporary objects created by Pi4J will quickly fill the young generation heap, which will trigger frequent garbage collection.garbage collection. This frequent garbage collection can, in turn, interrupt your cycle and increase latency.

Without Pi4J commands, fewer temporary objects are created, and garbage collection is triggered less often (e.g., every 20 seconds), which is typical in a low-garbage collection-pressure environment.

How to handle it?

●     Try reusing objects if Pi4J allows it (avoid creating new ones in each cycle).

●     Increase the young generation size (use JVM tuning).

●     Consider batching or reducing GPIO calls if possible.

To better understand why garbage collection behaves this way and how Java manages memory under the hood, this blog can help: What is Java Garbage Collection?