Login Action Required

The NinevehGL Forum uses a new concept of "socialized forum" or as we like to say "Tweet Forum".


Here is the deal:
  1. No new registration is required. Just sign in with your Twitter account and authorize the NinevehGL Forum.
  2. Once you’re in, you'll be able to "Follow a Thread", that means every time that thread receive a new post or update you'll receive a mention on your twitter.
  3. Besides, you can enable "Auto Share", then every new post and/or thread you make will be tweeted on your timeline. (By default, auto-share is enabled only for your threads)

Forum Rules:

1. We understand human comunication can become "hot" sometimes. So some insults and bad words ARE allowed. Just don't push too much being an asshole all the time.

2. SPAMMERS are not allowed. There are penalties for this kind of user and they can be banned forever.

3. You can report other users, if you judge necessary. An user reported many times by many people can also be banned forever. However you can also receive penalties for report deliberately for no apparent reason.

If there is a similar thread title, make sure the other one doesn't already have the answer you're looking for.

This forum uses the BBCode (Bulletin Board Code), here are some instructions:

Bold: [b]text[/b]
Italic: [i]text[/i]
Underline: [u]text[/u]

Code: [code]text[/code]
Quote:
[quote=@username]text[/quote]
[quote]text[/quote]

List:
[ul] [*]item [/ul]
[ol] [*]item [/ol]

URL:
[url]http://url.com[/url]
[url=http://url.com]text[/url]

Image:
[img]http://imageurl.com[/img]

Embed (videos, code, 3D):
[embed]http://url.com[/embed]

Welcome to the NinevehGL's world!
NinevehGL is a 3D engine forged with pure Obj-C.
Welcome to the
Forum!
Hello, Guest.

Your current vote:

You can change your vote many times. But it's still one single vote.

NGLMesh memory leak - app crash
Vote this thread:


@emrares

Posts: 7

NGLNewbie

Fri, Nov 2 2012


I think NGLMesh has a big memory leak. I'm developing a OBJ model viewer, my app loads an OBJ model and the user can rotate and view from different angles. After several load actions the app reaches the memory limit and the watch dog kills the app.
0% like this - 0/0

@dineybomfim

Posts: 571

NGLAdmin

Sat, Nov 3 2012


In response to: @emrares

This is answered in other threads in this forum.
You should NOT load and reload the same NGLMesh. It was not made for that!
0% like this - 0/0

@emrares

Posts: 7

NGLNewbie

Mon, Nov 5 2012


In response to: @dineybomfim

I am not using the same NGLMesh instance. I'm creating a different NGLMesh each time but loading the same model.
0% like this - 0/0

@dineybomfim

Posts: 571

NGLAdmin

Mon, Nov 5 2012


In response to: @emrares

OK, so post your code here.
0% like this - 0/0

@emrares

Posts: 7

NGLNewbie

Tue, Nov 6 2012


In response to: @dineybomfim

In my project I have a bunch of products if the user taps a product a viewcontroller appears and loads a 3d model ( OBJ file ). The loading process can be interrupted at any time, or the window can be closed after the loding finished and the user can tap another product.




@interface COThreeDeeController ()

@property (nonatomic, strong) NGLMesh* mesh;
@property (nonatomic, strong) NGLCamera* camera;
@property (nonatomic, strong) UIButton* cancelLoadingButton;
....
@end

- (void)viewDidLoad
{
[super viewDidLoad];
self.view.multipleTouchEnabled = YES;
self.isLoadingModel = FALSE;

self.cancelLoadingButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
....
[self loadModel];
}


- (void)loadModel
{
self.isLoadingModel = TRUE;
self.cancelLoading = FALSE;

NSDictionary *settings = [NSDictionary dictionaryWithObjectsAndKeys:
//kNGLMeshOriginalYes, kNGLMeshKeyOriginal,
kNGLMeshCentralizeYes, kNGLMeshKeyCentralize,
@"0.65", kNGLMeshKeyNormalize,
nil];
self.isLoadingModel = TRUE;
self.mesh = [[NGLMesh alloc] initWithFile:@"Human-knight.obj" settings:settings delegate:self];
self.camera = [[NGLCamera alloc] initWithMeshes:self.mesh, nil];
[self.camera autoAdjustAspectRatio:YES animated:YES];
}


- (void) meshLoadingDidFinish:(NGLParsing)parsing
{
self.progress.progress = parsing.progress;
[self.progress removeFromSuperview];
self.isLoadingModel = FALSE;
[self.cancelLoadingButton setHidden:TRUE];

if (self.cancelLoading == TRUE )
{
[self.camera removeAllMeshes];
self.mesh = nil;
[self.cancelLoadingButton setHidden:TRUE];
[self.delegate closeThreeDeeView];
}
else
{
UIBarButtonItem *closeButton = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"wcirclex.png"]
style:UIBarButtonItemStyleBordered
target:self
action:@selector(closeThreeDeeView:)];
self.navigationItem.leftBarButtonItem = closeButton;
[self.cancelLoadingButton setHidden:TRUE];
((NGLView*)self.view).delegate = self;
}
}

//method called when the user wants to close the viewcontroller
- (void)closeThreeDeeView:(UIButton*)button
{
[self.camera removeAllMeshes];
self.mesh = nil;
self.camera = nil;
[self.delegate closeThreeDeeView];
}

//method called when the user taps the cancel loading button
-(void)stopLoadingMesh:(UIButton*)button
{
self.cancelLoading = TRUE;
[self.mesh cancelLoading];
[self.cancelLoadingButton setEnabled:FALSE];
}

0% like this - 0/0

@emrares

Posts: 7

NGLNewbie

Tue, Nov 6 2012


In response to: @emrares

I made a small test app. You can download it from here

http://dl.dropbox.com/u/519131/NinivehMemoryLeak.zip

Please test this app on your device. In order to see the memory problem use the "activity monitor" tool from Instruments and load the model a few times.

Thanks,
Rares
0% like this - 0/0

@dineybomfim

Posts: 571

NGLAdmin

Wed, Nov 7 2012


In response to: @emrares

Hello buddy,

Well, there is a lot of problems with the example you send. You're doing a lot of wrong things even with ARC. I hope you're not doing the same in your project. This NinevehGL implementation doesn't even have a NGLView, how could you expect it's a valid example?

Anyway, there is no leaks here nor in NinevehGL, what there is in this project is a lot of things being allocated without purpose. Take a look at the NinevehGL sample projects and lessons, if you find any leak in there, we'll investigate.
0% like this - 0/0

@emrares

Posts: 7

NGLNewbie

Thu, Nov 8 2012


In response to: @dineybomfim

I know I didn't put the NGLView in the example. I just wanted to load a NGLMesh in memory and release it when the view controller it's closed. I will take a look at the examples once again.

Thanks for your time,
Rares
0% like this - 0/0

@emrares

Posts: 7

NGLNewbie

Thu, Nov 8 2012


In response to: @dineybomfim

So... I made another test app starting from the NinivehGL template project.

You can download the code from here

http://dl.dropbox.com/u/519131/SecondMemoryLeakTest.zip

I tested the app on the device with the "Activity monitor" tool from Instruments and the app keeps getting bigger and bigger.

Please take a look and tell what am I doing wrong. I really like this framework and I want to use it but I cannot find out what am I doing wrong.

Big thank you,
Rares
0% like this - 0/0
Technology

NinevehGL is a 3D engine built right on top of OpenGL ES and it uses all the programmable pipeline power, making it easy for you to create great application with shaders.

Share on


Follow NinevehGL
Fastest way to contact us:

Copyright © 2011 db-in. All rights reserved.