Why does my Mathematica program use 100% CPU but very little RAM and still not finish after hours?

Hi everyone,

I have a Mathematica program that takes an extremely long time to process and still doesn’t produce any result, even after more than 15 hours of runtime.

Here are my system details:

Supercomputer with 256 GB RAM
8 cores, each running at 3.7 GHz
Mathematica uses all CPU cores but only around 3–4 GB of RAM

Despite this, the computation doesn’t seem to progress efficiently. I’d like to understand:

Why is Mathematica using all the CPU but so little memory?

What are the best practices to optimize my code (e.g., parallelization, memory management, symbolic vs numeric evaluation)?

How can I identify the performance bottlenecks in my code?

If helpful, I can share a simplified version of my code to analyze where the slowdown occurs.

Any advice on improving speed or diagnosing such behavior would be greatly appreciated!

Thanks in advance!

This is my code. also i use vs 12.

If I try I0[30, 8000] or I1[30, 8000] I get warnings of the form NIntegrate failed to converge to prescribed accuracy

it really doesnt matter. if you decrease m range, like 1 to 1000, it gives result. but anyway the result isnt accurate. the problem is that if we increase m range to 10000 it takes very long time.

If I change a series to integral I have almost horizontal dot-line on two plots ?

The first one is correct. Thank you alot.