Welcome to the new Gigaspaces XAP forum. To recover your account, please follow these instructions.

Ask Your Question

Too many opened files

I recently changed not to cache IMap instances returned by CacheFinder.find calls. So that I can use transactions on it later.

However, when trying to introduce a lot of loads, I got "Too many opened files" exception from Cache API. I took a lot at netstat and found that it opens roughtly 80 listening connections on port 4160 as well as many ports on available port number on 60000++ ranges. Is it an expected behavior? If not, how can I resolve it?


{quote}This thread was imported from the previous forum. For your reference, the original is [available here|http://forum.openspaces.org/thread.jspa?threadID=2086]{quote}

asked 2007-08-23 11:16:00 -0500

testy gravatar image

updated 2013-08-08 09:52:00 -0500

jaissefsfex gravatar image
edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted


can you please open a support case (web2case.html">http://gigaspaces.com/suweb2case.html) and also provide your phone number... so we can faster track this down.


GigaSpaces Technical Support Team

answered 2007-08-23 12:10:04 -0500

bernard gravatar image
edit flag offensive delete link more

BTW, again, I'm using embedded mode.

answered 2007-08-23 11:23:02 -0500

testy gravatar image
edit flag offensive delete link more


The following code ran ok if "create=false" is specified in the url. If I remove it, the leak will occur.

{code} import com.j_spaces.map.CacheFinder; import com.j_spaces.map.IMap;

public class TestLeak extends junit.framework.TestCase { public void testLeak() throws Exception { IMap map = (IMap)CacheFinder.find("/./testCache?schema=mycache&versioned=false&create=true&noCache=false"); map.put("1","1", 100); for(int i=0; i<1000; i++) { IMap newMap = (IMap)CacheFinder.find("/./testCache?creeate=false"); } Thread.sleep(500);


} {code}

testy gravatar image testy  ( 2007-08-23 12:56:00 -0500 )edit

What are you tried to do? I am not sure that this is the way to achieve what you are after.

What you are doing here is to start (create) 1000 different spaces...

guy sayar gravatar image guy sayar  ( 2007-08-23 13:12:05 -0500 )edit


you are creating 1000 spaces here.. this is certainly not possible. what are you trying to do ?


bernard gravatar image bernard  ( 2007-08-23 13:20:05 -0500 )edit

Basically, I don't want to share IMap instances in my code as I will need to use transaction since the 5.2 API doesn't allow a nice way to use transaction since I have to call setTransaction which should not be called across thread. It seems that in 6.0 API, there are get/put method where I can pass transaction object in there.

testy gravatar image testy  ( 2007-08-23 13:27:03 -0500 )edit
  1. BTW, I did that because I followed the document at http://www.gigaspaces.com/wiki/displa... . If noCache property is set to false, it should not create a new container every time I called it. But it didn't look like it worked.

{quote} EMBEDDED_NOT _CACHE_MODE noCache When noCache=true, a new instance of the Container is initialized at each SpaceFinder.find() invocation. This allows you to run multiple container instances in one JVM. When noCache=false, a singleton Container is returned {quote}

  1. Also the document at http://www.gigaspaces.com/wiki/displa... suggested that I can get IMap multiple times from CacheFinder.find as well. If I should not do that, probably this document should be revised. If I can do that, then I have another comment, CacheFinder.find seems to be too slow for my usage, it takes 50 - 100 ms to return when I set "create=false" parameter.
testy gravatar image testy  ( 2007-08-23 14:04:03 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2007-08-23 11:16:00 -0500

Seen: 104 times

Last updated: Aug 23 '07