asp.net - System.OutOfMemoryException -


I have a program written in asp.net from lucene.net. Firstly I am making an index with 28000 documents. Secondly, I am performing a search but sometimes there is an error (I think this error is thrown when there are many results)

Important part of the code:

  dim hit hit = explorer Search (Query) Due to the result, the integer = hit Long () 'Ergabnis (Gross's Fear Hit)' ################### '####### Results #####' #### ###### trefferanzahl = Result if (result> 0) then integer such as dim h as DIM I = result - 1 redesigned array_results (h, 6) "array zoom reporting von den" failden "dim cellx Result for I = 0 as a new tableclay () - 1 step 1 as a dim tmpdoc document = hit.doc (i) 'error here is! Double = hit as the scoring score.core (i) msbx ( "2. Dockname:" and Hits. Array_results (i, 0) + = tmpdoc.Get ("doc_typ") array_results (i, 1) = tmpdoc ("title"); ("title")) array_pad (i, 0) = tmpdoc.Get ("title" Gate ("pfad") array_results (i, 2) = tmpdoc.Get ("date_of_create") array_results (i, 3) = tmpdoc.get ("last_change") array_results (i, 4) = tmpdoc.get ("id "), 'Load' this item only once ItemsGrid.DataSource = CreateDataSource () ItemsGrid.DataBind () Other bool_Suchergebnis = Unreal end if the searcher. Close ()  

Thanks in advance

In a large collection A good theory when searching is to limit the results of processing as soon as possible I will assume that you are implementing paging in your grid and assuming that PageSize is 20.

What you need to do is make sure that within this method you have access to the page size and the current page. To move the leaks (pages), leave the result set on and leave (page no * pages). You only have to process 20 records.

Then, you have two options, if you are bound directly with the array, you can participate with empty objects, but I am not sure, therefore you have to send the dummy item data in all those situations The source should be placed in the array which will not be displayed. Not ideal, but it is definitely fast to process from 1000s of hits.

The second option is to bind only 20 items in a grid, which will be quick, stop paging on the grid because it will only show one page and then implement your paging behavior as you know PageSees , And not the current page It will work more, but it will perform very fast in comparison to the binding out-of-box gridview for a large data source.

And it will help you solve your memory problem.


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -