Go to Post If you look closer, you'll see I did those photos over a period of years... and they were only done with one program... but yeah, a little free time with no where to direct it and I can become, um, creative... - MissInformation [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 02-01-2012, 12:01 AM
Ian Kaplan Ian Kaplan is offline
Registered User
FRC #1155 (SCiBORGS)
Team Role: Programmer
 
Join Date: Mar 2010
Rookie Year: 2010
Location: New York
Posts: 8
Ian Kaplan is an unknown quantity at this point
MemPartAlloc Error When Trying to Access the NIVision Library

So we've been trying to use the NIVision library to process images, but we've been hitting this exception while running our camera code. This is the exception:

Exception while getting image
[cRIO] edu.wpi.first.wpilibj.image.NIVisionException
[cRIO] 0xeccc20 (camera task executor): memPartAlloc: block too big 1259784 bytes (0x8 aligned) in partition 0x34f600

Can anyone shed some light on this?

We do use image.free() to clear the memory on the images, so if anyone has any ideas on what the problem may be please leave your thoughts below.

Thanks.
Reply With Quote
  #2   Spotlight this post!  
Unread 02-08-2012, 11:52 PM
kingofirony kingofirony is offline
Registered User
FRC #0694
 
Join Date: May 2011
Location: New York City
Posts: 6
kingofirony is an unknown quantity at this point
Re: MemPartAlloc Error When Trying to Access the NIVision Library

I am currently experiencing the same issues with the NIvision library. It'd be fantastic if someone had any advice. If not, I'm planning on finding out exactly where this error occurs in my code on friday. If I learn anything useful, I'll post my findings.
Reply With Quote
  #3   Spotlight this post!  
Unread 02-09-2012, 03:03 AM
RufflesRidge RufflesRidge is offline
Registered User
no team
 
Join Date: Jan 2012
Location: USA
Posts: 985
RufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant future
Re: MemPartAlloc Error When Trying to Access the NIVision Library

Use the Charts tab on the Driver Station to see how much total memory you have free and the size of the largest block.
Reply With Quote
  #4   Spotlight this post!  
Unread 02-09-2012, 10:44 AM
derekwhite's Avatar
derekwhite derekwhite is offline
Java Virtual Machine Hacker
no team (FIRST@Oracle)
Team Role: Programmer
 
Join Date: May 2009
Rookie Year: 2009
Location: Burlington, MA
Posts: 127
derekwhite is on a distinguished road
Re: MemPartAlloc Error When Trying to Access the NIVision Library

I found a memory leak in NIVision.particleFilter(). I believe WPI is working on it...

If you feel daring, you could modify WPILibJ's NIVision class (sunspotfrcsdk/lib/WPILibJ/src/edu/wpi/first/wpilibj/image/NIVision.java) with this UNTESTED FIX:


Code:
    /* THIS IS AN UNTESTED FIX */
    public static int particleFilter(Pointer dest, Pointer source, CriteriaCollection collection) throws NIVisionException {
        Pointer particleFilterOptions = new Pointer(16);
        particleFilterOptions.setInt(0, 0);
        particleFilterOptions.setInt(4, 0);
        particleFilterOptions.setInt(8, 0);
        particleFilterOptions.setInt(12, 1);
        IntByReference i = new IntByReference(0);
        Pointer criteriaArray = collection.getCriteriaArray();
        assertCleanStatus(imaqParticleFilter4Fn.call7(dest.address().toUWord().toPrimitive(),   // dest image
                                                    source.address().toUWord().toPrimitive(),   // source image
                                                    criteriaArray.address().toUWord().toPrimitive(),  // array of criteria
                                                    collection.getNumberOfCriteria(),           // number of criteria in the array
                                                    particleFilterOptions.address().toUWord().toPrimitive(),  // particle filter options
                                                    0,                                          // Region of interest
                                                    i.getPointer().address().toUWord().toPrimitive()));  // returned number of particles
        int numberOfParticles = i.getValue();
        i.free();
        criteriaArray.free();
        particleFilterOptions.free();
        return numberOfParticles;
    }
Reply With Quote
  #5   Spotlight this post!  
Unread 02-09-2012, 10:46 AM
notmattlythgoe's Avatar
notmattlythgoe notmattlythgoe is offline
Flywheel Police
AKA: Matthew Lythgoe
FRC #2363 (Triple Helix)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Newport News, VA
Posts: 1,712
notmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond repute
Re: MemPartAlloc Error When Trying to Access the NIVision Library

You have to make sure to release any images that you create, since they are being ported from C they do not get automatically garbage collected. Use the .free() method on any images.
Reply With Quote
  #6   Spotlight this post!  
Unread 01-11-2013, 03:54 PM
sretter's Avatar
sretter sretter is offline
Registered User
AKA: Shaked
FRC #2231 (OnyxTronix)
Team Role: Leadership
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Shoham
Posts: 33
sretter is on a distinguished road
Re: MemPartAlloc Error When Trying to Access the NIVision Library

I got the same issue this year-anyone found a good solution?
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 07:45 AM.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi