TagCloud problem "Server Out Of Memory"

Jul 31, 2008 at 8:20 AM
Edited Jul 31, 2008 at 11:17 AM

At the beginning when i deployed the TagCloud feature on simple site, it worked perfectly.
But when i expanded the site and created 100 subsites, the TagCloud feature stopped working properly with the error ""The SPTagCloud" Web Part appears to be causing a problem . Server Out Of Memory."
I analyzed the code and found that the "Bot" iterate itself with the number each item in the each list in each subsite!!
Did any one found a way to enhance the code?

Aug 17, 2008 at 11:03 PM
Edited Aug 18, 2008 at 2:27 PM
At the end i decided to make the enhancement by myself, i changed the whole technique the code is currently running by, the new technique depends on the database querying rather than site/subsites iterations.

what i did actually is dividing the code to 3 levels:

1) Initiating: in this level a small code will run and collect all the tags from the sites/subsites and store them(the tag name, tagURL, item name, item URL) in the table (this code runs only one time).

2) Reading: after that i modified the source code (TagCloud 1.2) to read all the tags from the table, so no need to check the tags in each field for each item for each list in a site when rendering the webpart.

3) Updating: the last issue left is the accuracy, i made 3 events handler (update, delete, add) these handlers guarantee that any change in the tags is reflecting immediately in the table, so the tags will stay consistence.

I'm sure that this technique is much more efficient from the original one, it's perfect for those who has limited resources (low quality sharepoint server) with huge number of sites.