Verifinger Java JNDI

General information about Neurotechnology and its software

Re: Verifinger Java JNDI

Postby Pavel » Apr 04, 2008 08:15

This error is thrown, when native function is trying to allocate some memory and operating system can't give it. Usually this is happening, when JVM heap size limits are reached. You can set you own limits by using virtual machine parameters for java:

Code: Select all
-Xms<some_min_size> -Xmx<some_max_size>

-Xms<size> set initial Java heap size
-Xmx<size> set maximum Java heap size
-Xss<size> set java thread stack size


Also this exeption may be thrown, if there is other limitation for memory usage to application.
Kind regards,
Pavel Cuchriajev

Neurotechnology
Pavel
Neurotechnology
 
Posts: 48
Joined: Feb 15, 2008 12:40
Location: Vilnius, Lithuania

Re: Verifinger Java JNDI

Postby sstarcher » Apr 04, 2008 13:06

I have watched the JVM memory usage and it does not seem to be approaching the threashold. I have -Xms912m -Xmx1100m -XX:MaxPermSize=512m as my current settings.
The memory error always seems to happen while using the JNDI if it was just the overal JVM running out of memory it should crash on one of the normal java lines of code also. Which makes me want to believe that it's something more then the JVM itself running out of memory.

Would loading 2k templates cause it to over run 1gb of memory. It normally loads around 1500 templates before it goes down. These are templates of approx 3-9kb each.

I would also like to pose another question. I attempted to load the templates into the JRecord instead of storing all of the JRecords in hope of not running out of memory.

Essentially the flow is
Code: Select all
matcher.startIdentify()
loop
record = new JRecord(templateData)
matcher.identifyNext(record);
record.finalize()
end loop

randomly after it runs anywhere between template 50 and template 1000 JRecord(templateData) will throw an exception or cause a JVM Hot Spot error and fully crash the JVM.
The code looks like
Code: Select all
Vector<TemplateID> dataVec =  DB.getTemplates(pos.eval(),CONN);
      if(dataVec!=null){
         JRecord target = generateTemplate(image, pos, type);
         matcher.startIdentify(target);
         JRecord matchTargetRecord = new JRecord(dataVec.get(1).getTemplate());
         for(TemplateID data : dataVec){
            byte[] templateBytes = data.getTemplate();
            if(templateBytes!=null){
                  byte[] template = data.getTemplate();
                  int score = -1;
                  if(template!=null){
                     matchTargetRecord = new JRecord(data.getTemplate());
                     MatchDetails details = matcher.identifyNext(matchTargetRecord);
                     score = details.getScore();
                     matchTargetRecord.finalize();
                  }
            }   
         }
sstarcher
 
Posts: 6
Joined: Mar 04, 2008 16:16

Re: Verifinger Java JNDI

Postby sstarcher » Apr 08, 2008 14:02

The changes I received to finalize seems to have improved the system.

When I try to load the JRecords and hold them in memory I am able to load 2k without a large memory footprint. After matching on them a few times it throws a hot spot error and crashes. Which I'm not to concerned with since I was not viewing any performance improvements.

What I am concerned with is that every identification that is done increases the memory footprint until it runs out of memory. Garbage collection never seems to kick in to remove the garbage created by the matcher. After matching on the finger print around 20 times at 2k matchers per I run out of memory at my current 1.2gb threshold.

Any idea what I can do to cause the matcher to release it's memory?
sstarcher
 
Posts: 6
Joined: Mar 04, 2008 16:16


Return to Public

Who is online

Users browsing this forum: Bing [Bot] and 2 guests

cron