Originally Posted by TwoRoads
Originally Posted by Astaroth
What is being done on Line 329 of functions_search.php
? There is obviously a memory allocation going on there which is failing. It might be trying to create a list of items which is too long. Might it be related to the fact that there are probably more threads started with the character string "SotD" than any other? Just shooting in the dark here ...
Astaroth may be on to something here.
It was worse with tonight's thread. I could not even use 'SotD' in the title. The thread was finally accepted when I submitted it with a title of 'Thursday, 19 Feb 09' and 'meh' as the body of the post. I was then able to edit my post without problem - adding 'SotD' to the title and changing the body.
OK, here's what I think is going on under the hood. Hopefully Grant will be able to confirm whether this is right or not ...
step in storing the new thread on the server is probably using a hash function
to determine a single integer which becomes an index into an array of thread storage linked lists. Unfortunately, the hash function is probably a weak
function which only depends upon the first few characters in the title of the thread. The SotD threads typically start with "SotD" and then the day of the week, with very little variation. This has probably been going on for years now. With only 7 different days in the week, the linked lists corresponding to those 7 corresponding values of the array index are storing many
more threads than the other indexed array locations. So the memory limitation does not result from the global
memory allocation (which Grant keeps increasing), but on the ability of the server to load the linked lists of threads into RAM from the database. Those 7 lists are so huge, it is probably taxing the server's virtual memory too much.TwoRoads
may have been able to fool the server into placing the SotD thread into an atypical linked list by avoiding the character string "SotD", and his subsequent editing of the title apparently did not move the thread out of that list into its "normal" location. Another thing that might have worked would be putting a random character string prefix at the beginning of the title, and then editing it away.
There are other variations on this theme, such as storage in an unbalanced binary tree which keys on initial letters of the title. The high prevalence of "SotD" in the titles would then create a huge depth to such a tree. It's also possible that the data structures storing the keywords for Search are being taxed by the huge number of threads which have "SotD" and the days of the week in the title. There are lots of possibilities here, all of them resulting from some sort of non-randomizing key generation algorithm.
Having said all this, it's still
a weird problem since the main method by which the server accesses the threads is through a numerical thread ID, which you can see in your browser's URL as you read this (223206
). My suspicion at this point is that it probably has something to do with the functions which facilitate Search, since TwoRoads
implied he couldn't have the string "SotD" anywhere in the initial title.
Grant, what is being done on Line 329 of functions_search.php