[maemo-developers] C - Hildon - Memory usage
From: David Hautbois david.hautbois at free.frDate: Sat Feb 9 16:43:29 EET 2008
- Previous message: MMPC: No .install file in extras repository
- Next message: C - Hildon - Memory usage
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi
I'm a newbie with C programming and make many errors with memory
management (memory allocation, freeing memory...).
So, I'm aware about the memory used by my application.
I play with "top" and see my application uses 100MB !!!
I check my code and see the problem is here :
********************************************************
void kml_browse_btn_clicked ( GtkWidget * widget, gpointer data) {
GtkWidget * HildonDialog;
HildonDialog = hildon_file_chooser_dialog_new(GTK_WINDOW(pKmlBoite),
GTK_FILE_CHOOSER_ACTION_SAVE);
getchar();
if (gtk_dialog_run (GTK_DIALOG (HildonDialog)) == GTK_RESPONSE_OK) {
gchar *chooser_filename = gtk_file_chooser_get_filename
(GTK_FILE_CHOOSER (HildonDialog));
gtk_entry_set_text( GTK_ENTRY(LocaldirEntry), chooser_filename);
}
gtk_widget_destroy (HildonDialog);
(void) widget;
(void) data;
}
******************************************************************
Before "HildonDialog = hildon......."
My application uses 36Mb.
After (getchar), it uses 100Mb !!!:
VmPeak: 92288 kB
VmSize: 92284 kB
VmLck: 0 kB
VmHWM: 12736 kB
VmRSS: 12736 kB
VmData: 67484 kB
VmStk: 84 kB
VmExe: 40 kB
VmLib: 13504 kB
VmPTE: 56 kB
When, I validate the dialog windows, "gtk_widget_destroy" does not free
the memory.
The application always uses 100Mb.
I'm a newbie, but I think there is a problem....
Some help is needed.
Thanks.
David.
--
Web site : http://david.hautbois.free.fr
Tablet users map : http://david.hautbois.free.fr/maps/index.php
- Previous message: MMPC: No .install file in extras repository
- Next message: C - Hildon - Memory usage
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
