forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Can't figure it out !
Goto page 1, 2  Next
 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
Rubes_sw
Valued Contributor
Valued Contributor


Joined: 11 Jun 2001
Posts: 625
Location: Northern Ireland

PostPosted: Thu Mar 20, 2003 2:30 pm    Post subject: Can't figure it out ! Reply with quote

I used Tommys Resource Compiler 1.3 to compile several BMPs and 2 GIFS into a resource file for my program, resource file size: 843Kb.

When i run my program using the resource file it cosumes: over 20Mb in RAM.

But when i use the original bmps and gifs in the same directory calling them directly. It Only uses 5.6 Mb

Is this a bug or i am doing something wrong?

Nathan
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Rubes_sw
Valued Contributor
Valued Contributor


Joined: 11 Jun 2001
Posts: 625
Location: Northern Ireland

PostPosted: Thu Mar 20, 2003 2:45 pm    Post subject: Reply with quote

Ok, i have also tried: HASM Resource Compiler v1.0

And I left out the gifs, and just complied the bmps, same thing is happening. Roughly about 20Mb RAM being used Shocked

Is this a bug can anyone confirm, give a idea to remedy !!!

Nathan
Back to top
View user's profile Send private message Send e-mail Visit poster's website
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Thu Mar 20, 2003 2:49 pm    Post subject: Reply with quote

Can you give a few more technical details, i.e. how much RAM you have,
your computer manufacturer, processor speed etc., which could turn out
to be useful. Wink

Also, how many bitmaps are you putting into the resource file and how
large are the bitmaps all together without being in a resource file. How
are you measuring the memory loss?

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
Rubes_sw
Valued Contributor
Valued Contributor


Joined: 11 Jun 2001
Posts: 625
Location: Northern Ireland

PostPosted: Thu Mar 20, 2003 2:53 pm    Post subject: Reply with quote

OK, STATS:

I am creating a resource file called: cpc.dsr

There are: 25 Bitmaps Totaling: 797Kb (not compiled into resource file)

I am using Windows XP Pro, 240Mb Ram, 40Gb Hard Disk. 1.2Ghz Processor

I am using Windows XP Task Manager to register the memory being used.

Thanks for any help !, this is really messing my program up, Size Wise !(running)

Nathan
Back to top
View user's profile Send private message Send e-mail Visit poster's website
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Thu Mar 20, 2003 3:05 pm    Post subject: Reply with quote

OK, just to be sure, let's test this. I'm not exactly sure if there's 1000 bytes
in a MB or 1024 or something. But let's use 1024 because I think that's
right. Wink

Use the following code; make sure to show the dialog, then post the
results:

Code:
%%start_mem = @sysinfo(freemem)
REM -- Put dialog definitions here --
REM DIALOG SHOW
%%end_mem = @sysinfo(freemem)
%%loss = @fsub(%%start_mem,%%end_mem)
%%loss = @fdiv(%%loss,1024)
info There was a %%loss MB loss while using your program.
exit

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Thu Mar 20, 2003 3:08 pm    Post subject: Reply with quote

There are 1024 bytes in a KiloByte(Kb) and 1000 KiloBytes in a MegaByte(Mb). Smile
_________________
Bill Weckel
ShinobiSoft Software

"The way is known to all, but not all know it."
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
Rubes_sw
Valued Contributor
Valued Contributor


Joined: 11 Jun 2001
Posts: 625
Location: Northern Ireland

PostPosted: Thu Mar 20, 2003 3:11 pm    Post subject: Reply with quote

OK, when using the Resource file:

There was a 16.18359375 MB loss while using your program.

When calling the bitmaps and not the resource file:

There was a 4.91796875 MB loss while using your program.

Nathan (does this help ?)
Back to top
View user's profile Send private message Send e-mail Visit poster's website
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Thu Mar 20, 2003 3:40 pm    Post subject: Reply with quote

... So that means it only takes 4 MB of RAM, doesn't it? Confused
_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
Rubes_sw
Valued Contributor
Valued Contributor


Joined: 11 Jun 2001
Posts: 625
Location: Northern Ireland

PostPosted: Thu Mar 20, 2003 3:46 pm    Post subject: Reply with quote

Another thing the program loads faster when i do not use the resource file. (I use the bitmaps)

I can't figure it out !, it should not really consume that much resources should it ?

The main reason i want to use the resource is so that no-one can change the bitmaps my program uses, and it's tider !

Nathan
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Thu Mar 20, 2003 3:56 pm    Post subject: Reply with quote

I don't understand how the resource file is getting loaded into memory
anyway. Your app should only be extracting images from the resource file
as they are needed. The only thing I can figure, and I hope I'm wrong, is
the the routine that extracts the images from the resource file is not deleting
the object handles. At least if VDS were written in C/C++ that would be a
possible answer but since it's written in Delphi, I can only speculate.

_________________
Bill Weckel
ShinobiSoft Software

"The way is known to all, but not all know it."
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Thu Mar 20, 2003 4:01 pm    Post subject: Reply with quote

lol, must be braindead.Smile Forgot to mention that the following line:
Code:

%%loss = @fdiv(%%loss,1024)


is returning Kb not Mb. For Mb it should be:
Code:

%%loss = @fdiv(@fdiv(%%loss,1024) ,1000)


And that will only work without error if the memory consumed is greater than 1000 Kb, otherwise it will generate a maths error.

_________________
Bill Weckel
ShinobiSoft Software

"The way is known to all, but not all know it."
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
Rubes_sw
Valued Contributor
Valued Contributor


Joined: 11 Jun 2001
Posts: 625
Location: Northern Ireland

PostPosted: Thu Mar 20, 2003 4:05 pm    Post subject: Reply with quote

%%start_mem = @sysinfo(freemem)
returns size as Kb (as per VDS help File)

Nathan

Any help will be great on this problem !
Back to top
View user's profile Send private message Send e-mail Visit poster's website
PGWARE
Web Host


Joined: 29 Dec 2001
Posts: 1565

PostPosted: Thu Mar 20, 2003 4:06 pm    Post subject: Reply with quote

Delphi doesn't extract the images/files to disc. It uses a TStream to read the data into a stream and sends the binary information directly to a TImage etc so it loads the bitmap/gif etc. It's a direct binary transfer from file to control.
Why not try to use the resoruce compiler that comes with the registered users pack? It's a simple commandline compiler and I know it works error free. It supports any type of file as well.
Back to top
View user's profile Send private message
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Thu Mar 20, 2003 4:10 pm    Post subject: Reply with quote

I stand corrected twice. Embarassed But you still aren't getting an accurate MB reading
by dividing it by 1024. If @sysinfo(freemem) returns in Kb, it must be divided
by 1000 to get Mb.

And PGWARE thanks for the Delphi lesson, I wasn't aware that that is how
Delphi deals with the resource extraction. Smile

_________________
Bill Weckel
ShinobiSoft Software

"The way is known to all, but not all know it."
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
Tommy
Admin Team


Joined: 16 Nov 2002
Posts: 746
Location: The Netherlands

PostPosted: Thu Mar 20, 2003 8:01 pm    Post subject: Reply with quote

bweckel wrote:
There are 1024 bytes in a KiloByte(Kb) and 1000 KiloBytes in a MegaByte(Mb). Smile


1024 kilobytes make a megabyte, even though opinions differ on this:

http://whatis.techtarget.com/definition/0,,sid9_gci212542,00.html
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group