🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

performance

Started by
9 comments, last by drBones 23 years, 11 months ago
ok... I got this. I started some time ago ( when I got my riva tnt2 m64 ) and everything was ok, except one ( annoing ) thing... Everything compiles fine, runs fine, but sometimes execs run reaaally slooow... i have to reboot and run again to have everything fine. It''s not a memory problem ( I think ) cause I free everything I allocated. Maybe it''s necessery to release some handles or memory after I initialized ( but it happens even with tutorials ) btw... I use bcc32 but it doesn''t matter ( please don''t tell me if it is cause i''m not gonna switch to MS VC ... ever...) hey ... and btw... Can anyone tell me the difference between malloc, alloc and new functions ( do they alloc the ''whole'' RAM or just the famous 640 kb ( not !!! right ? he he ) There''s farmalloc ( and etc. ) but in win32 coding is there sill a difference ??? thanks in advance Pet
Pet
Advertisement
There are no 64kb or 640kb limits on malloc in win32. i think in end effect, none of the memoey allocation rutines are much different, they all allocate memory on the heap.



Edited by - Claus Hansen Ries on August 3, 2000 10:36:24 AM
Ries
When your app slows down, is the hard disk thinking at the time? If it is, then rebooting your machine is the best thing to do.

Solve the problem by going to system (under control panel) and virtual memory. Do it manually, and set both the minimum and maximum to TWICE the amount of RAM you have. This gives best performance, and means that Windows hardly ever has to change the size of the swap file. Also means you need to defrag less often!

Funky Chicken



========
Smidge
www.smidge-tech.co.uk
========
--Mr Smidge
Thanks y''all...
that''s not it... I have my swapfile fixed for a long time now... hard drive is calm when my OGL progs. suddenly slow down, the other apps run fine and quick... I can live with that, it''s not happening so often but, if it is - it really p****s me off ( sorry for my lang. but it''s true )
maybe some of you coped with the problem similar ... help

and ''bout memory ... what is the best way to allocate it for my models or texture or whatever ... anyone of them ( the one that I prefer ) ??? or a particular one ???

thanks
Pet
Pet
Hi Pet,

malloc is a fn. in alloc.h which allocates memory according to how much you said you needed. If you tell it you need memory for say a structure of your own which has a size of say 300 bytes, then it would set aside 300bytes of memory for your structure.

the fn. "new" is used in C++ and it does a little more than just memory allocation. It also constructs your objects (in other words initialises them).

Heap allocation is not always the case, in case of local variables, memory is allocated on the stack.

If you are coding in C++, definitely go with new and also consider redifining the new handler in your code. Sometimes, new does more than you want it to so you might want to write your own operator new. For your textures, I would suggest read up a little on texture memory and how OpenGL and you can manage it.
Hi Pet,

malloc is a fn. in alloc.h which allocates memory according to how much you said you needed. If you tell it you need memory for say a structure of your own which has a size of say 300 bytes, then it would set aside 300bytes of memory for your structure.

the fn. "new" is used in C++ and it does a little more than just memory allocation. It also constructs your objects (in other words initialises them).

Heap allocation is not always the case, in case of local variables, memory is allocated on the stack.

If you are coding in C++, definitely go with new and also consider redifining the new handler in your code. Sometimes, new does more than you want it to so you might want to write your own operator new. For your textures, I would suggest read up a little on texture memory and how OpenGL and you can manage it.
One thing that I''ve noticed is that NeHe doesn''t usually call glDeleteTextures() at the end of the program, so, the textures don''t get released from your graphics card. On one of my computers (only 6MB of VRAM), it crashes when the card gets full. Your computer may have the same problem if the demo you are using doesn''t have a call to glDeleteTextures() in it. So, what''s probably happening is that your VRAM on your graphics card is getting full, when this happens OpenGL starts reading the textures from its memory space (yes, OpenGL is a dll, so it gets its own memmory space), and reading the textures from there, which is R E A L L Y S L O W...

Morgan
thanks... I will !
you know, I used to call "alloc family" functions... but maybe it''s time I should switch to new ? stack maybe not enough ...
thanks again

Pet
Pet
Hi Morgan ...
You posted the time I was answering
That''s probbly it !!! thanks man ... but I''ll check as soon as I get home ... man, am I glad to get your answer ...

thanks ...

Pet
I was,like, incognito... huh huh huh
Pet

This topic is closed to new replies.

Advertisement