|
Iain Clarke wrote: win32 checkmark
Maybe he meant "checked-build" Windows.
Maxwell Chen
|
|
|
|
|
That would make some sense. But I guessed at his meaning before, and he told me off.
(My skin is not *that* thin really - I've been told off much more bluntly!)
Iain.
|
|
|
|
|
Iain Clarke wrote: That would make some sense. But I guessed at his meaning before, and he told me off.
Maxwell Chen
|
|
|
|
|
SEREFSIZ MAYMUN GÖT. PIÇ ANASI BENLE SIKISMIS PISKIN MAYMUN MAHLUK UTANMAZ PISKIN MAYMUN NE IDIÜ BELIRSIZ YARATIK. PISIRIYIM MI SENI ANASINI SIKTIMIN TEKNOLOJISI UTANMAZ MAYMUN UTAN NE OLUR YAA BIRAK PESIMI KAFAYI BENLE MI YEDIN OLUM SEN SAGIR MISIN KIMSIN NESIN AMINA KODUGUMUN GÖTÜ. PIÇ, ANASINI SIKTIMIN SEREFSIZI, MAYMUNU, GÖTÜ, SIKTIMIN HIRSIZI, KENDINE AIT SEYLERE SAHIP ÇIK AMINA KODUGUMUN PIÇI. SENIDE ISINE SIKERIM BENI RAHAT BIRAK LAN ANASINI SIKTIMIN MAYMUNU.
|
|
|
|
|
Hakan D wrote: Win32 CheckMarked platform
Is this function what you need?
OutputDebugString
Maxwell Chen
|
|
|
|
|
Neyin varda seni pisireyim? Birak pesimi yaa kafayi benle mi yedin neolur birak pesimi yaa lütfen rica ediyorum benle ugrasmaktan vazgeç neolur sana yalvariyorum yaa birak pesimi neolur lütfen birak sana yalvariyorum artik beni alma yapabilir misin bilmiyorum ama benim pesimi birak neolur beni alma neolur birak pesimi sana yalvariyorum neolur yaaa birak artik birak yaaa kimsin nesin hiç mi utanman arlanman yok seni tanimiyorum yaa birak neolur pesimi birak nolur birak yeter artik benle ugrasmaktan vazgeç kendine baska bi is bul neolur yaaa olmasi lazim kendine ait seyler olmasi lazim beni rahat birak neolur
|
|
|
|
|
I'm going to guess that Maxwell does not speak your language. As there are very few little words, and mixing if ü (scandivian roots) and ç (slavic) I'm not even going to guess what the language is.
This is a canadian website, and the people who visit it are from all over the world. I think most people who visit use english as a second language. If you want help from more than 0.01% of people, you will too.
If you have trouble with english, I understand. I'm not good with other languages either (though I can use a bit of french, dutch, and swedish). If you think that Maxwell will help you after your reply, then you are beyond help.
Iain.
|
|
|
|
|
You're a wise guy, I really admire you.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
I was tempted to bite my tongue - but it appears I woke up on the wrong side of the bed today...
Beware my wrath, evil posters!
Iain ( )
|
|
|
|
|
Hakan D wrote: Neyin varda seni pisireyim? Birak pesimi yaa kafayi benle mi yedin neolur birak pesimi yaa lütfen rica ediyorum benle ugrasmaktan vazgeç neolur sana yalvariyorum yaa birak pesimi neolur lütfen birak sana yalvariyorum artik beni alma yapabilir misin bilmiyorum ama benim pesimi birak neolur beni alma neolur birak pesimi sana yalvariyorum neolur yaaa birak artik birak yaaa kimsin nesin hiç mi utanman arlanman yok seni tanimiyorum yaa birak neolur pesimi birak nolur birak yeter artik benle ugrasmaktan vazgeç kendine baska bi is bul neolur yaaa olmasi lazim kendine ait seyler olmasi lazim beni rahat birak neolur
Okay, you speak Turkish very well. But I don't understand Turkish though.
Maxwell Chen
|
|
|
|
|
when i debug my project using vs,such output messages were dumped:
Detected memory leaks!
Dumping objects ->
d:\work\ipodlibrarys\ipodlibrarys\ipodsmarttool\ipodsmarttooldlg.cpp(328) : {4306} normal block at 0x012EA938, 16 bytes long.
Data: < & > 1A 00 00 00 26 04 00 00 00 00 00 00 00 00 00 00
0x012EA7D8, 16 bytes long.
Data: < > 17 00 00 00 20 04 00 00 00 00 00 00 00 00 00 00
....
{3710} normal block at 0x012E9C78, 484 bytes long.
Data: <\Ok @ ( > 5C 4F 6B 00 40 00 96 01 28 00 00 00 00 04 00 00
d:\work\ipodlibrarys\ipodlibrarys\ipodsmarttool\ipodsmarttooldlg.cpp(328) : {3698} normal block at 0x012E9438, 16 bytes long.
Data: < & > 1A 00 00 00 26 04 00 00 00 00 00 00 00 00 00 00
........(too many items!)
someone would like to tell me,how sould i find where the memory leaking occurred?
Thanks.
|
|
|
|
|
Well, you have the address, the initial byte pattern and the length, usually it is quite enough to match the offending code.
[added]
I forgot you have the character representation of the initial byte pattern too.
[/added]
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
okay,i have fixed most of the leaking code now.
but,there are some ones remain,like:
Detected memory leaks!
Dumping objects ->
{211} normal block at 0x003BA6D8, 7 bytes long.
Data: <\\.\G: > 5C 5C 2E 5C 47 3A 00
{208} normal block at 0x003BCDA0, 34 bytes long.
Data: 47 3A 2F 69 50 6F 64 5F 43 6F 6E 74 72 6F 6C 2F
{204} normal block at 0x003BCCD8, 32 bytes long.
Data: 47 3A 2F 69 50 6F 64 5F 43 6F 6E 74 72 6F 6C 2F
{197} normal block at 0x003BA5A8, 36 bytes long.
Data: < G: > 01 00 00 00 00 00 00 00 CD CD CD CD 47 3A 00 CD
{194} normal block at 0x003BC6A8, 7 bytes long.
Data: <\\.\G: > 5C 5C 2E 5C 47 3A 00
Object dump complete.
I can't find the offending code,this time.there is only leaking address and memory long info.
In addition,it seems strang: G:/iPod_Control is a directory,but my sourcecode is not there!
waht the dump message mean?
|
|
|
|
|
Well, I know you're smart guy, hence you can easily figure out that "\\.\\G:" is an hint that a string (for instance, a CString) containing that path is leaking, it isn't a link to your source code.
You have to check the objects that hold such paths at runtime.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
ok.
I think I can fixed it by myself now.
Thank you very much.
|
|
|
|
|
|
Ok,thanks for give me such link.I am reading now.
Regards.
|
|
|
|
|
Hello everyone,
I found using performance counter API and using perfmon counter will result in different numeric result. Here is an example, and in the example code, virtual bytes is always larger than working set, but in perfmon, working set is always larger than working set.
Any ideas?
#include <windows.h>
#include <stdio.h>
#include <pdh.h>
#include <atltime.h>
#pragma comment(lib, "pdh")
PDH_STATUS ps;
CHAR wsPath[256];
CHAR vbPath[256];
DWORD wsItems = 0;
DWORD wsSize = 0;
DWORD vbItems = 0;
DWORD vbSize = 0;
FILE* fLog = fopen("perfcount.log", "w+");
CHAR processModule[MAX_PATH] = {0};
CHAR* GetProcModuleName()
{
if (GetModuleFileName(GetModuleHandle(NULL), processModule, sizeof(processModule)))
{
CHAR* p = strrchr(processModule, '.');
if (p)
*p = '\0';
else
return NULL;
p = strrchr(processModule, '\\');
if (p)
return (p + 1);
}
return NULL;
}
void GetCounters(DWORD sectionIndex)
{
HQUERY hQuery;
HCOUNTER hWsCount;
HCOUNTER hVbCount;
ps = PdhOpenQuery(NULL, 0, &hQuery);
ps = PdhAddCounter(hQuery, wsPath, 0, &hWsCount);
ps = PdhAddCounter(hQuery, vbPath, 0, &hVbCount);
ps = PdhCollectQueryData(hQuery);
wsItems = 0;
wsSize = 0;
vbItems = 0;
vbSize = 0;
PDH_RAW_COUNTER_ITEM* pWS = NULL;
PDH_RAW_COUNTER_ITEM* pVB = NULL;
ps = PdhGetRawCounterArray(hWsCount, &wsSize, &wsItems, NULL);
pWS = (PDH_RAW_COUNTER_ITEM*)LocalAlloc(LPTR, wsSize);
ps = PdhGetRawCounterArray(hVbCount, &vbSize, &vbItems, NULL);
pVB = (PDH_RAW_COUNTER_ITEM*)LocalAlloc(LPTR, vbSize);
ps = PdhGetRawCounterArray(hWsCount, &wsSize, &wsItems, pWS);
ps = PdhGetRawCounterArray(hVbCount, &vbSize, &vbItems, pVB);
ps = PdhCloseQuery(hQuery);
CTime t = pWS->RawValue.TimeStamp;
fprintf(fLog, "[%s] SI: %6d\t WS: %.2f Mb\tVB: %.2f Mb\n",
t.Format("%c"),
sectionIndex,
double(pWS->RawValue.FirstValue) /1024 /1024,
double(pVB->RawValue.FirstValue) /1024 /1024);
LocalFree(pWS);
LocalFree(pVB);
fflush(fLog);
}
int main(int argc, char* argv[])
{
LARGE_INTEGER start,end;
LARGE_INTEGER freq;
QueryPerformanceCounter(&start);
QueryPerformanceFrequency(&freq);
MEMORYSTATUS memstat;
void** map;
int sectionIndex = 0;
memstat.dwLength = sizeof(memstat);
GlobalMemoryStatus(&memstat);
long long size = 512*1024*1024;
DWORD nsize = 0;
CHAR poName[256];
CHAR wsName[256];
CHAR vbName[256];
nsize = sizeof(poName);
ps = PdhLookupPerfNameByIndex(NULL, 230, poName, &nsize);
nsize = sizeof(wsName);
ps = PdhLookupPerfNameByIndex(NULL, 180, wsName, &nsize);
nsize = sizeof(vbName);
ps = PdhLookupPerfNameByIndex(NULL, 174, vbName, &nsize);
PDH_COUNTER_PATH_ELEMENTS pcpe = {0};
pcpe.szObjectName = poName;
pcpe.szInstanceName = GetProcModuleName();
pcpe.szCounterName = wsName;
nsize = sizeof(wsPath);
ps = PdhMakeCounterPath(&pcpe, wsPath, &nsize, 0);
pcpe.szCounterName = vbName;
nsize = sizeof(vbPath);
ps = PdhMakeCounterPath(&pcpe, vbPath, &nsize, 0);
HANDLE mapping =
CreateFileMapping(INVALID_HANDLE_VALUE,NULL,PAGE_READWRITE|SEC_COMMIT,(DWORD)(size >> 32),DWORD(size),NULL);
if (mapping)
{
SYSTEM_INFO sysInfo;
GetSystemInfo(&sysInfo);
const int allocSize = sysInfo.dwAllocationGranularity;
GlobalMemoryStatus(&memstat);
void *mem = new char[allocSize];
memset(mem,0x11,allocSize);
map = (void**) new char [sizeof(void*) * size / allocSize];
for (int i=0; i<1; i++)
{
sectionIndex = 0;
for (long long offset=0; offset <= size-allocSize; offset+=allocSize)
{
map [sectionIndex] =
MapViewOfFile(mapping,FILE_MAP_WRITE,(DWORD)(offset << 32),(DWORD)offset,allocSize);
if (map [sectionIndex])
{
memcpy(map [sectionIndex],mem,allocSize);
GetCounters(sectionIndex);
}
sectionIndex++;
}
for (sectionIndex = 0; sectionIndex < size/allocSize; sectionIndex++)
{
if (map [sectionIndex])
{
UnmapViewOfFile(map [sectionIndex]);
}
}
GlobalMemoryStatus(&memstat);
sectionIndex = 0;
for (long long offset=0; offset<=size-allocSize; offset+=allocSize)
{
map [sectionIndex] =
MapViewOfFile(mapping,FILE_MAP_READ,(DWORD)(offset << 32),(DWORD)offset,allocSize);
if (map [sectionIndex])
{
for (int t=0; t < allocSize; t++)
{
if (((char *)(map [sectionIndex]))[t]!=0x11)
{
OutputDebugString("Memory read failed\n");
}
}
GetCounters(sectionIndex);
}
UnmapViewOfFile(map [sectionIndex]);
sectionIndex++;
}
GlobalMemoryStatus(&memstat);
}
QueryPerformanceCounter(&end);
GlobalMemoryStatus(&memstat);
printf("Time %.3f\n",
double(end.QuadPart-start.QuadPart)/double(freq.QuadPart));
CloseHandle(mapping);
delete[] mem;
GlobalMemoryStatus(&memstat);
}
fclose(fLog);
return 0;
}
</atltime.h></pdh.h></stdio.h></windows.h>
thanks in advance,
George
|
|
|
|
|
To big to read.
Come online at:-
jubinc@skype
|
|
|
|
|
Hi Don,
Sorry that I have not found the function to attach source file, so I post the source code here. The reproduce of this issue is quite easy,
1. Build the code and run;
2. At the same time, using perfmon tool to monitor the working set and virtual bytes counter;
3. When running compelte, check the content in file perfcount.log.
In Perfmon tool, you can always find working set is larger than virtual bytes;
In the perfcount.log, you can always find virtual bytes is larger than working set.
If you either could tell me how to attach a file into the forum or tell me your email address, I can send you the code so that you can build and reproduce very easily.
regards,
George
|
|
|
|
|
George_George wrote: ...working set is always larger than working set.
Really? That would indeed indicate a problem.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi DavidCrow,
You can have a try and it is easy to reproduce. If you want to get the code directly to save time, I can send you code through email.
I am not sure whether it is my mistake for the code and for the tool? So, it is appreciated if you could have a review.
regards,
George
|
|
|
|
|
Project Title: Student Information System
Project Description:
This program is supposed to assist schools in keeping records of students and their information
Project Features:
The Student Information System contains record of students and one record should have following fields about a student
• Student ID
• Student Name
• Student Father Name
• Registration Number
• Student Class
• Address
• Date of birth
The Student Information System should have the following features
1. Register a new Student into School System
2. Update an existing student record
3. Delete an existing student record
4. Search a student record by
a. By Student ID
b. By Student Name
5. View All Student Records
6. Exit –to exit from application
Student Information System should also support persistence for student records
Supporting simple persistence by any application requires handling of two scenarios
• On start up of application-data (student records) must be read from file.
• On end/finish up of application -data (student records) must be saved in file.
|
|
|
|
|
Well, good luck with your project then !
|
|
|
|
|
Oh, well defined requirements, nice programming language, enjoy yourself.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|