Skip to content

Memory Leak PyMapdl #3041

Answered by clatapie
lucaRubHsg asked this question in Q&A
Apr 29, 2024 · 1 comments · 10 replies
Discussion options

You must be logged in to vote

Hello,

I ran the following script using Windows10, MAPDL 2023R2 and ansys-mapdl-core 0.68.1:

process = psutil.Process(os.getpid())
base_memory_usage = process.memory_info().rss

for i in range(0,1001):
    memory_usage = process.memory_info().rss
    loop_memory_usage = memory_usage - base_memory_usage
    if i%5 == 0:
        print(f"Iteration {i:4.0f}\t\t| Memory usage: {memory_usage/1024:0.0f}\t| Loop memory: {loop_memory_usage/1024:0.0f}")
    a = calculate_energy()

Here are the results I obtained:

Details

Iteration    5          | Memory usage: 141060  | Loop memory: 100
Iteration   10          | Memory usage: 141068  | Loop memory: 108
Iteration   15          | Memory usage: 141072…

Replies: 1 comment 10 replies

Comment options

You must be logged in to vote
10 replies
@germa89
Comment options

@lucaRubHsg
Comment options

@germa89
Comment options

@clatapie
Comment options

Answer selected by germa89
@lucaRubHsg
Comment options

@germa89
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants