This project has moved. For the latest updates, please go here.

About flick api's search problem

Topics: Developer Forum
Feb 6, 2013 at 3:09 AM
I tried to use flickr api to search photos in recent year, and i met a problem.

When the program is running, it always met the same exception at FlickrNet.PhotosSearch(...).

the problem description is
System.OutOfMemoryException 未處理
Message="已發生類型 'System.OutOfMemoryException' 的例外狀況。"
   於 FlickrNet.UtilityMethods.ReadString(Stream s)
   於 FlickrNet.PersistentCache.Load(Stream s)
   於 FlickrNet.PersistentCache.Refresh()
   於 FlickrNet.PersistentCache.Get(String key, TimeSpan maxAge, Boolean removeIfExpired)
   於 FlickrNet.Flickr.GetResponse[T](Dictionary`2 parameters, TimeSpan cacheTimeout)
   於 FlickrNet.Flickr.GetResponseCache[T](Dictionary`2 parameters)
   於 FlickrNet.Flickr.PhotosSearch(PhotoSearchOptions options)
   於 GetFlickrInfo.Form1.BtnFullCrawl_Click2() 於 C:\Users\santoun\Desktop\Flickr_crawler2\Flickr_crawler2\Flickr_crawler\GetFlickrInfo\Form1.cs: 行 1716
   於 System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   於 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   於 System.Threading.ThreadHelper.ThreadStart()
I'm very sure that the Memory is enough to use, and the photos we search are not large.
can someone help me to deal with this problem?

Feb 6, 2013 at 6:17 AM
I solved the problem.

I add this program

Flickr.CacheDisabled = true
Feb 6, 2013 at 7:44 AM
But I have met another problem on another computer.

I use the same program to run on the other computer, it appear another exception in the same place

could someone help me?
Feb 6, 2013 at 11:36 AM
Disabling the cache would be one work around.

An overflow exception is different from an out of memory exception. The out of memory exception seems to imply that your cache file has grown too big. Try calling Flickr.Flush() to flush the cache as well.

An overflow exception is usually when it tries to load an integer into a field that can't hold a number that big (e.g. you set a byte (0-255) to 266).

If you could tell us what you search parameters are I could try to reproduce your errors and see if there is a problem with the data Flickr is returning or a change required in my code.