Tudat / tudat

NOTE: This Tudat version is no longer supported. See https://docs.tudat.space/en/stable/ and https://github.com/tudat-team/tudat-bundle for the new version
BSD 3-Clause "New" or "Revised" License
87 stars 142 forks source link

Memory issue with multi-objective optimization #518

Closed Palash-Patole closed 5 years ago

Palash-Patole commented 5 years ago

@DominicDirkx Dear Dominic,

I am trying to find the optimum solution(s) to a Lambert targeting problem using the Multi Objective Evolutionary Algorithms by Decomposition (MOEA/D) algorithm of the PaGMO toolbox. The iteration loop (maximum 5 iterations) for evolving the island of population size (25 individuals) begins but the program crashes after 3 iterations. When the PC memory performance is analyzed, I observed that at the crash, the usage reaches peak value where almost all the available memory is being used. [Option-1]

To resolve this issue, I followed the solution suggested by you on the Brightspace forum for one of the old post regarding the same issue-

What could help is defining your bodyMap outside of your fitness function. Create it as a member variable in your problem class, and reuse the same body map for each function evaluation

I implemented this solution [Option-2]. However, my application still crashes (even when it is not consuming large memory usage). The reason is unknown (debugger in windows didn't help), but I suspect that it is when the island object is created (i.e even before the iteration loop begins).

I checked my header file, main cpp file containing the definition of fitness function, but I was unable to identify the error.

I also tried using a "mutable" type "NamedBodyMap" object, but it didn't help either. [Option -3].

Can you please have a look at the code and give me some direction? I have added you as the collaborator on a private repository.

Thanks.

DominicDirkx commented 5 years ago

Hi Palash, please add the link to your repository here

Palash-Patole commented 5 years ago

Dear Dominic,

I am sorry about that. I forgot to include it.

https://github.com/Palash-Patole/Issue_resolver

Thanks.

DominicDirkx commented 5 years ago

A few points/questions:

Palash-Patole commented 5 years ago

Dear Dominic,

  1. When you asked me to push all the necessary files to Github, I added these files to my local repository (which is different than my personal working repository), added the application to my CMakeLists.txt file and run it to make sure everything works fine with this new repository.

  2. To my surprise, there was only one error and when I rectified it, I was able to get the results without the application crashing when [Option-2] mentioned in my original issue post was implemented.

  3. When the same error was rectified in original .cpp file of the application in my personal working repository (not the one shared with you), I still face the issue of application crashing.

  4. So, my concern now is finding out what exactly I am doing wrong with my personal working repository. I am pretty sure the application from this repository is correctly added to the CMakeLists.txt file and eventually to Qt environment (as [Option-1] mentioned in my original issue post works until it crashes due to limited available memory).

I will try to resolve this (probably a trivial) problem on my own. Before I close this Github issue, can you just the run application once and let me know whether it works on your system?

DominicDirkx commented 5 years ago

Hi Palash,

Without running anything myself, doesn't this mean that you have now solved your problem? Apparently there is a difference between the two repositories (why do you have two?) you have, and you now have on that works!

Dominic

Palash-Patole commented 5 years ago

Dear Dominic,

Yes, I have (almost) resolved my problem.

I created two repositories to avoid sharing plethora of other files in my personal working repository which are irrelevant to this issue and to cause less confusion. I keep these multiple other files on Github personal working repository for my own use. :)

Nevertheless, many thanks for your input. I hope to identify differences between two repositories. 👍