This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Memory usage

Tags: None
(comma "," separated)
Luke-Jr
Registered Member
Posts
1
Karma
0

Memory usage

Thu Jul 27, 2006 5:24 pm
KTorrent eats memory-- 14.9% of 1 GB, almost double that of X.
The memory usage setting is set at Low. 150 MB is not in any way "low"...
Why is this?
George
Moderator
Posts
5421
Karma
1

Re: Memory usage

Fri Jul 28, 2006 4:26 pm
Luke-Jr wrote:KTorrent eats memory-- 14.9% of 1 GB, almost double that of X.
The memory usage setting is set at Low. 150 MB is not in any way "low"...
Why is this?


That only applies to the amount of memory used for the current chunks you are downloading (low = 10 MB, medium = 20 and high 40 MB)

I have noticed that memory usage is 2 to 3 times higher on amd 64 systems then on 32 bit systems. My main computer is a amd64, my old one a Pentium 3.

To be honest, we haven't really done any effort to actively reduce memory usage.
J
Registered Member
Posts
86
Karma
0

Re: Memory usage

Sat Jul 29, 2006 8:22 am
George wrote:I have noticed that memory usage is 2 to 3 times higher on amd 64 systems then on 32 bit systems.


64-bit code has 64-bit pointers.
George
Moderator
Posts
5421
Karma
1

Re: Memory usage

Sun Jul 30, 2006 7:34 am
J wrote:
George wrote:I have noticed that memory usage is 2 to 3 times higher on amd 64 systems then on 32 bit systems.


64-bit code has 64-bit pointers.


That was one of my suspicions, but I didn't expect that much increase.
J
Registered Member
Posts
86
Karma
0

Sun Jul 30, 2006 11:48 am
Code: Select all
#include <iostream>

using namespace std;

int main() {
        cout << "char:\t\t\t" << sizeof(char) << endl;
        cout << "unsigned char:\t\t" << sizeof(unsigned char) << endl;
        cout << "short:\t\t\t" << sizeof(short) << endl;
        cout << "unsigned short:\t\t" << sizeof(unsigned short) << endl;
        cout << "int:\t\t\t" << sizeof(int) << endl;
        cout << "unsigned int:\t\t" << sizeof(unsigned int) << endl;
        cout << "long:\t\t\t" << sizeof(long) << endl;
        cout << "unsigned long:\t\t" << sizeof(unsigned long) << endl;
        cout << "long long:\t\t" << sizeof(long long) << endl;
        cout << "unsigned long long:\t" << sizeof(unsigned long long) << endl;
        cout << "long long:\t\t" << sizeof(long long) << endl;
        cout << "unsigned long long:\t" << sizeof(unsigned long long) << endl;
        cout << "float:\t\t\t" << sizeof(float) << endl;
        cout << "double:\t\t\t" << sizeof(double) << endl;
        cout << "long double:\t\t" << sizeof(long double) << endl;
        cout << "void*:\t\t\t" << sizeof(void*) << endl;
        return 0;
}


Code: Select all
$ gcc sizeof.cpp -o sizeof64 -lstdc++ -m64 -march=athlon64 && ./sizeof64
bool:                   1
char:                   1
unsigned char:          1
short:                  2
unsigned short:         2
int:                    4
unsigned int:           4
long:                   8
unsigned long:          8
long long:              8
unsigned long long:     8
long long:              8
unsigned long long:     8
float:                  4
double:                 8
long double:            16
void*:                  8


Code: Select all
$ gcc sizeof.cpp -o sizeof32 -lstdc++ -m32 -march=athlon-xp && ./sizeof32
bool:                   1
char:                   1
unsigned char:          1
short:                  2
unsigned short:         2
int:                    4
unsigned int:           4
long:                   4
unsigned long:          4
long long:              8
unsigned long long:     8
long long:              8
unsigned long long:     8
float:                  4
double:                 8
long double:            12
void*:                  4


Basically, in those two cases only pointers (void*), (unsigned) long and long double differ in memory consumption. I hope this helps.


Bookmarks



Who is online

Registered users: abc72656, Bing [Bot], daret, Google [Bot], lockheed, Sogou [Bot], Yahoo [Bot]