Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by david.martinelli · Mar 26, 2015 at 11:17 PM · c#unity 5pluginc++

Unity5 filled my SSD?

Hello everyone, I had a weird issue using Unity5 on mac (Yosemite). I was running a scene that queries a plugin almost every frame and use a WebcamTesture. When the application was running for 5 minutes Unity allerted me that there wasn't enought space on disk to continue the task and it shutted down. The odd stuff is that I never write on disk (SSD) in my script. So something filled 33GB of memory in about 5 minutes.

Can someone help me to understand what could be the error?

thank you.

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image AlwaysSunny · Mar 26, 2015 at 11:17 PM 1
Share

"I was running a scene that queries a plugin almost every frame and use a WebcamTesture"

What does the plugin do? What are you doing with the webcam texture? Can you disable one or the other to figure out which is responsible, or are they interdependent?

Unity does not write excessive amounts of data like this unless you ask it to. Something you or this plugin is doing is responsible. Please answer these questions and show us some code so we have something to look at.

avatar image david.martinelli · Mar 27, 2015 at 10:22 AM 0
Share
  • What does the plugin do? The plugin that I'm using is a class that try to detect faces using OpenCV.

  • What are you doing with the webcam texture? I'm getting an handler of the webcam texture that is passed to the plugin and the texture is rendered on a Plane.

  • Can you disable one or the other to figure out which is responsible, or are they interdependent? I tryed every combination but I can't figure out what the problem is.

  • Here is the code in c#

    void Update () {
    if(!webcamReady) return;

        isExecuting = true;
         pixels = webcamTexture.GetPixels32();
         pixelsHandle = GCHandle.Alloc(pixels, GCHandleType.Pinned);
     
         webcamWidth = webcamTexture.width;
         webcamHeight = webcamTexture.height;
     
         $$anonymous$$arshal.PtrToStringAuto(faceDetection(pixelsHandle.AddrOfPinnedObject(), webcamWidth, webcamHeight));
     
         gameObject.GetComponent<SpriteRenderer>().material.mainTexture = webcamTexture;
     }
    
     
    
    

This is the c++ code:

 const char * faceDetection( char * data ,  int  width ,  int  height, int i)
 {    
     Debug("Facedetection start");
     
     string s_faces_coord_X;
     string s_faces_coord_Y;
     string s_centerWidth;
     string s_centerHeight;
     string facesCoordinates = "";
     string empty = "emptyData";
     
     //Vector of Rects.
     std::vector<Rect> faces;
     
     IplImage *  p  =  cvCreateImageHeader ( cvSize ( width ,  height ),  IPL_DEPTH_8U ,  4 );
     cvSetData ( p ,  data ,  p -> widthStep );
         
     $$anonymous$$at frame = cvarrTo$$anonymous$$at(p);
     $$anonymous$$at frame_gray;
         
     flip(frame,frame,0);
     
     cvtColor(frame, frame_gray, COLOR_BGR2GRAY );
     
     equalizeHist( frame_gray, frame_gray );
     
     Debug("Detect Face $$anonymous$$ultiscale");
     face_cascade.detect$$anonymous$$ultiScale( frame_gray, faces, 1.1, 2, 0, Size(120, 120) );
     
     
     for( size_t i = 0; i < faces.size(); i++ )
     {
         // Do something with face
     }
     
     cvReleaseImageHeader ( & p );
 
     const char * facecoord;
     
     if (facesCoordinates.size() != 0)
         facecoord = facesCoordinates.data();
     else
         facecoord = empty.data();
     
     return facecoord;
  }
 

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

C++ plugin for Unity “EntryPointNotFoundExeption” 0 Answers

Multiple Cars not working 1 Answer

Windows Universal IAP 0 Answers

C++ Plugin for mipmapping and JPG encoding: viability 0 Answers

Communication between Unity and Arduino Yun via WiFI 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges