Jump to content
TNG Community

{SOLVED] Direct Ancestors time out


Jan Suhr

Recommended Posts

I have uploaded a new Gedcom to my site and everything looks OK. 
When I in Direct Ancestors perform a recalculate it will after  a while timeout: On my local site I get this error message.
Calculation of the new ancestors data of Jan Urban Suhr (I41309054, Jan Suhr släktforskning)
in progress ...........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 67108872 bytes) in C:\xampp\htdocs\tng_15u\admin_direct_ancestors.php on line 568


On my public site I get a 504 error

It also make the database corrupt and not working. For site to come alive I have to import a backup to the database.

This is when I try it for my ancestors.

Doing the same thing for my wife's ancestors it works fine.

I haven't had any problems with it before doing the recalculations.

When I create a branch for my ancestors I have over 5200 individuals, can it be that there is a limit on how many it can handle?
Or could it be some problem with an individual in the database?

I was thinking that I could ad a logging code bit to see where it fails, where should that go if so? Maybe some where around line 568?

Thanks

Link to comment
Share on other sites

Jan,

There are 3000 people in my TNG server of which about 500 are my grandson's direct ancestors.

It takes about 1 second to recalculate the ancestors data. I added several memory_get_usage() in the PHP code. All values were between 630000 and 670000.

I understand that you have 10 times more ancestors than me and this can impact the execution time and the memory usage, but I can hardly believe that it explains why your memory usage is about 1000 times bigger than mine.

I'll continue my investigations.

Maybe you can make a recalculation starting from your father or from your grandfather or another ancestor to check if the problem is related to a particular individual in the database.

Jean-Luc

Link to comment
Share on other sites

Hi Jean-Luc,

Last time I updated my site with a new Gedcom it had also around 5000 ancestors and it recalculated without any problem and quick too.

I suspect that there is some issue with some individual in the Gedcom that causes the problem. 
Is there a way that I can add some code to log the process and maybe find where it stalls?

The new Gedcom have 259 new individuals and I did a script with the help of ChatGPT that gave me a list of all the new persons. I can go over them one by one and see if there is any problem with some one. They did import to TNG without any problem.

Thanks

Jan

Link to comment
Share on other sites

Hi Jean-Luc,

With the help of ChatGPT I added a logging function that give me information on where it gets wrong and looping forever.
I can see in the database that it adds 1307 individuals to the database as direct ancestors and after that it loops.

In the log I created it just grow on and created a text file with over 300000 lines before I stopped it.

There is one individual that have the problem, I14715476 he is in the middle of a tree, he has 13 ancestors and 447 descendants so I can't really remove him. And then it is his parents too.

It starts to loop like this:

[2025-07-28 09:44:13] Found parents: husband=I14715476, wife=I72976155
[2025-07-28 09:44:13] Added husband I14715476 to generations
[2025-07-28 09:44:13] At least one parent added.
[2025-07-28 09:44:13] Processing generation I14715476 at level 24
[2025-07-28 09:44:13] Found familyID: F93233046
[2025-07-28 09:44:13] Found parents: husband=I36782976, wife=I88224042
[2025-07-28 09:44:13] Added husband I36782976 to generations
[2025-07-28 09:44:13] At least one parent added.
[2025-07-28 09:44:13] Processing generation I36782976 at level 25
[2025-07-28 09:44:13] Found familyID: F56523648
[2025-07-28 09:44:13] Found parents: husband=I14715476, wife=I72976155
[2025-07-28 09:44:13] Added husband I14715476 to generations
[2025-07-28 09:44:13] At least one parent added.
[2025-07-28 09:44:13] Processing generation I14715476 at level 26
[2025-07-28 09:44:13] Found familyID: F93233046
[2025-07-28 09:44:13] Found parents: husband=I36782976, wife=I88224042
[2025-07-28 09:44:13] Added husband I36782976 to generations
[2025-07-28 09:44:13] At least one parent added.
[2025-07-28 09:44:13] Processing generation I36782976 at level 27
[2025-07-28 09:44:13] Found familyID: F56523648

And when I stopped it it was up to level 72937

 

025-07-28 09:57:16] Found parents: husband=I14715476, wife=I72976155
[2025-07-28 09:57:16] Added husband I14715476 to generations
[2025-07-28 09:57:16] At least one parent added.
[2025-07-28 09:57:16] Processing generation I14715476 at level 72936
[2025-07-28 09:57:16] Found familyID: F93233046
[2025-07-28 09:57:16] Found parents: husband=I36782976, wife=I88224042
[2025-07-28 09:57:16] Added husband I36782976 to generations
[2025-07-28 09:57:16] At least one parent added.
[2025-07-28 09:57:16] Processing generation I36782976 at level 72937
[2025-07-28 09:57:16] Found familyID: F56523648
[2025-07-28 09:57:16] Found parents: husband=I14715476, wife=I72976155
[2025-07-28 09:57:16] Added husband I14715476 to generations
[2025-07-28 09:57:16] At least one parent added.[2
[2025-07-28 09:57:16] Processing generation I14715476 at level 72938
[2025-07-28 09:57:16] Found familyID: F93233046
[2025-07-28 09:57:16] Found parents: husband=I36782976, wife=I88224042
[2025-07-28 09:57:16] Added husband I36782976 to generations
[2025-07-28 09:57:16] At least one parent added.
[2025-07-28 09:57:16] Processing generation I36782976 at level 72939
[2025-07-28 09:57:16] Found familyID: F56523648
[2025-07-28 09:57:16] Found parents: husband=I14715476, wife=I72976155


The strange thing is that this guy was already added with my older Gedcom and then it worked.

You can email me directly for further discussions and maybe we can do a teams session for you to see.
jan.u.suhr@gmail.com

Link to comment
Share on other sites

I found the cause of the problem. He is his own grand child and that seems to loop in the tree.

How this have happened is a mystery but I'm the one to blame.

I'll fix this and then it would work properly
 

2025-07-28_10-46-08.PNG

Link to comment
Share on other sites

  • Jan Suhr changed the title to {SOLVED] Direct Ancestors time out

Do you want the file with the logging function, maybe some one need it

I can send it to you if you like.

 

Jan

Link to comment
Share on other sites

I confess I never tested a relationship like being one's own descendant.

I sent you a private message. Thanks.

Jean-Luc

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...