Friday, March 30, 2012
increase in CPU usage on lock and unlock of the system
When we open the application the CPU usage is 0% and the Memory Usage
is 54,324Kb
When I open a specific form in a module, the CPU usage is 0% and the
Memory Usage increases accordingly (67,730 Kb).
Now when I lock and unlock the System the CPU usage increases to 50%
with the Memory Usage being 67,730 kb.
I have made use of a .Net memory profiler and had taken snapshots
before locking and unlocking the system.
The following is the result after comparing both the versions.
NameSpace Name Total New Removed Delta Total
Max Min Delta
System WeakRefrence 1681 613 0 613 26896
16 16 9808
System.Reflection RunTimeMethodInfo 1229 8
0 8 29496 24 24 192
System.Windows.Forms NativeMethods.TracKMOU.. 10
5 0 5 240 24 24 120
System Runtimetype 2725 4 0 4 4360
16 16 64
System String 37232 5 1 4 2256 102456
18 458
Can anybody let me know the reason for the increase in CPU usage and
how I can overcome this.
And why is there a drastic increase in the number of instances for
WeakReference class when the operation is just locking and unlocking
and nothing to do with the application.
Thanks in advance
sowmyaIs this question related to SQL Server?. If so, please explain what you
mean by locking/unlocking. Perhaps you intended to post to a .Net forum.
--
Hope this helps.
Dan Guzman
SQL Server MVP
<sowmya.rangineni@.gmail.com> wrote in message
news:1182142975.732292.25730@.m36g2000hse.googlegroups.com...
> Ours is a windows based application.
> When we open the application the CPU usage is 0% and the Memory Usage
> is 54,324Kb
> When I open a specific form in a module, the CPU usage is 0% and the
> Memory Usage increases accordingly (67,730 Kb).
>
> Now when I lock and unlock the System the CPU usage increases to 50%
> with the Memory Usage being 67,730 kb.
>
> I have made use of a .Net memory profiler and had taken snapshots
> before locking and unlocking the system.
>
> The following is the result after comparing both the versions.
>
> NameSpace Name Total New Removed Delta Total
> Max Min Delta
> System WeakRefrence 1681 613 0 613 26896
> 16 16 9808
> System.Reflection RunTimeMethodInfo 1229 8
> 0 8 29496 24 24 192
> System.Windows.Forms NativeMethods.TracKMOU.. 10
> 5 0 5 240 24 24 120
> System Runtimetype 2725 4 0 4 4360
> 16 16 64
> System String 37232 5 1 4 2256 102456
> 18 458
>
> Can anybody let me know the reason for the increase in CPU usage and
> how I can overcome this.
>
> And why is there a drastic increase in the number of instances for
> WeakReference class when the operation is just locking and unlocking
> and nothing to do with the application.
> Thanks in advance
> sowmya
>
Monday, March 26, 2012
Incorrect syntax near the keyword "From"
Hi, I have Error when I write this SQL statement retrieving the non selected facilitator for a specific course:
The SQL statement:
SELECT facilitators.facilitator_id, facilitators.facilitator_name
FROM facilitators INNER JOIN
[transaction_ facilitators] ON facilitators.facilitator_id <> [transaction_ facilitators].trans_Facilitator_id
WHERE (NOT (facilitators.facilitator_id IN
(SELECT [transaction_ facilitators].trans_Facilitator_id
FROM [transaction_ facilitators]
WHERE [transaction_ facilitators].trans_Course_id = 2)))
GROUP BY facilitators.facilitator_id, facilitators.facilitator_name
ORDER BY facilitators.facilitator_id
Every thing goes right until I change this:
WHERE [transaction_ facilitators].trans_Course_id = 2
To
WHERE [transaction_ facilitators].trans_Course_id = @.course_id
It gives me this error:
Incorrect syntax near the keyword "From"
Any suggestion ??
Will it give the error before it takes the value.
:( I don't know what to do..
Its not working its sth with the passing parameter.
HELP…
The " Incorrect syntax near the keyword "From" error is appear to me while im using the query builder .
The error while using the code appears to be :
Invalid index 0 for this SqlParameterCollection with Count=0.
And the cose id:
IfNot Page.IsPostBackThen
Me.SqlConn.Open()
Me.SqlDataAdapter_Get_FaciliInfo.SelectCommand.Parameters(0).Value = 1'Request.QueryString.Get("courseid")
Me.SqlDataAdapter_Get_FaciliInfo.Fill(Me.Dataset_Get_PopUpFaciliInfo)
Me.DataGrid_Get_Info.DataBind()
Me.SqlConn.Close()
EndIf
...
|||
no its not that if you've noticed that i make it comment
Me.SqlDataAdapter_Get_FaciliInfo.SelectCommand.Parameters(0).Value = 1'Request.QueryString.Get("courseid")
And pass the parameter a value 1 and I still get the same error
|||ok let's try one more time is the following your query string for your commandtext?:SELECT facilitators.facilitator_id,facilitators.facilitator_name
FROM facilitatorsINNER JOIN
[transaction_facilitators] ON facilitators.facilitator_id <> [transaction_facilitators].trans_Facilitator_id
WHERE (NOT(facilitators.facilitator_id IN
(SELECT [transaction_facilitators].trans_Facilitator_id
FROM [transaction_facilitators]
WHERE [transaction_facilitators].trans_Course_id = @.code_id)))
GROUP BY facilitators.facilitator_id,facilitators.facilitator_name
if so, change the @.code_id to ?(question mark) so that the resulting command text will be:
SELECT facilitators.facilitator_id,facilitators.facilitator_name
FROM facilitatorsINNER JOIN
[transaction_facilitators] ON facilitators.facilitator_id <> [transaction_facilitators].trans_Facilitator_id
WHERE (NOT(facilitators.facilitator_id IN
(SELECT [transaction_facilitators].trans_Facilitator_id
FROM [transaction_facilitators]
WHERE [transaction_facilitators].trans_Course_id = ?)))
GROUP BY facilitators.facilitator_id,facilitators.facilitator_name
ORDER BY facilitators.facilitator_id
the reason being the @.<var> is a sql server reserved naming convention for its variable, it(Sql) assumed then that you declare a variable of that name, however since it isn't declared(coz it is being passed) it doesn't know how to generate a plan and gives you a cryptic error in FROM..
:( That's unbelievable… its not working what is this… look I try this:
SELECT DISTINCT facilitators.facilitator_id, facilitators.facilitator_name
FROM facilitators INNER JOIN
[transaction_ facilitators] ON facilitators.facilitator_id <> [transaction_ facilitators].trans_Facilitator_id
WHERE (NOT (facilitators.facilitator_id IN
(SELECT [transaction_ facilitators].trans_Facilitator_id
FROM [transaction_ facilitators]
WHERE [transaction_ facilitators].trans_Course_id = @.course_id)))
ORDER BY facilitators.facilitator_id
Not Working the same error: "Incorrect syntax near the keyword "From"
"
And I try this:
SELECT DISTINCT facilitators.facilitator_id, facilitators.facilitator_name
FROM facilitators INNER JOIN
[transaction_ facilitators] ON facilitators.facilitator_id <> [transaction_ facilitators].trans_Facilitator_id
WHERE (NOT (facilitators.facilitator_id IN
(SELECT [transaction_ facilitators].trans_Facilitator_id
FROM [transaction_ facilitators]
WHERE [transaction_ facilitators].trans_Course_id = @.course_id)))
GROUP BY facilitators.facilitator_id, facilitators.facilitator_name
ORDER BY facilitators.facilitator_id
Not Working the same error: "Incorrect syntax near the keyword "From"
"
And I try this:
SELECT facilitators.facilitator_id, facilitators.facilitator_name
FROM facilitators INNER JOIN
[transaction_ facilitators] ON facilitators.facilitator_id <> [transaction_ facilitators].trans_Facilitator_id
WHERE (NOT (facilitators.facilitator_id IN
(SELECT [transaction_ facilitators].trans_Facilitator_id
FROM [transaction_ facilitators]
WHERE [transaction_ facilitators].trans_Course_id = ?)))
GROUP BY facilitators.facilitator_id, facilitators.facilitator_name
ORDER BY facilitators.facilitator_id
Not Working the same error: "Incorrect syntax near the keyword "From"
"
And I try this:
SELECT facilitators.facilitator_id, facilitators.facilitator_name
FROM facilitators INNER JOIN
[transaction_ facilitators] ON facilitators.facilitator_id <> [transaction_ facilitators].trans_Facilitator_id
WHERE (NOT (facilitators.facilitator_id IN
(SELECT [transaction_ facilitators].trans_Facilitator_id
FROM [transaction_ facilitators]
WHERE [transaction_ facilitators].trans_Course_id = ?)))
ORDER BY facilitators.facilitator_id
Not Working the same error: "Incorrect syntax near the keyword "From"
"
Nothing work what is this… is it a curse ?
I don't have more time :'(… HELP
This error message would have an uppercase FROM if it were being generated from the code you have supplied so far.
Incorrect syntax near the keyword "From"I think you are looking in the wrong place for the code generating the error.
sql