ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ API Support » MGET: "Unable to allocate memory".

Post new topic  Reply to topic
 MGET: "Unable to allocate memory". « View previous topic :: View next topic » 
Author Message
patrick flaherty
PostPosted: Mon Mar 27, 2006 4:03 pm    Post subject: MGET: "Unable to allocate memory". Reply with quote

Novice

Joined: 27 Mar 2006
Posts: 14
Location: SF E Bay

Hi,

New to MQS but experienced programmer.

I wrote a first MQ Put perl script on Windows (downloaded and built the MQSeries module from CPAN). That worked.

Then wrote a listener (MQGET) in an MQSeries client that we have running on VMS (our legacy platform).

That worked also.

Am now trying to do an MQGET for the first time on Windows and received the following message:


DB<1> b 29
DB<2> c
main::(mqs_lookup.pl:29): $Buffer = MQGET($Hconn,$Hobj,$MsgDesc,$GetMsgOpt
s,$BufferLength,$CompCode,$Reason);
DB<2> n
Unable to allocate memory in MQGET!



My code

Quote:

use MQSeries;


$Hconn = MQCONN("",$CompCode,$Reason);
$ObjDesc = {
ObjectName => 'TEST5.QUEUE',
DynamicQName => 'FOOBAR*',
};
$Options = MQOO_INPUT_AS_Q_DEF | MQOO_FAIL_IF_QUIESCING;

$Hobj = MQOPEN($Hconn,$ObjDesc,$Options,$CompCode,$Reason);
($ReasonText) = MQReasonToText($Reason);



# $GetMsgOpts = {
# Options => MQGMO_FAIL_IF_QUIESCING | MQGMO_SYNCPOINT | MQGMO_WAIT,
# WaitInterval => MQWI_UNLIMITED,
# };
my $GetMsgOpts = { Options => MQGMO_FAIL_IF_QUIESCING | MQGMO_WAIT, WaitInterval => 600000,
MatchOptions => MQMO_NONE };
my $MsgDesc = {MsgId=>MQMI_NONE,CorrelId=>MQCI_NONE,Encoding=>MQENC_NATIVE,CodedCharSetId=>MQCCSI_Q_MGR};

# my $MsgDesc->{'Out' => MQFMT_STRING};

my $BuggerLength=512;
my $Buffer;

$Buffer = MQGET($Hconn,$Hobj,$MsgDesc,$GetMsgOpts,$BufferLength,$CompCode,$Reason);
# ($ReasonText) = MQReasonToText($Reason);


foreach $key (keys %$MsgDesc)
{
print "$key: %$MsgDesc->{$key}\n";
}

# parse message
@fields = split(" ",$Buffer);

$CloseOptions = {};
MQCLOSE($Hconn,$Hobj,$CloseOptions,$CompCode,$Reason);

MQDISC($Hconn,$CompCode,$Reason);
Back to top
View user's profile Send private message
patrick flaherty
PostPosted: Mon Mar 27, 2006 4:05 pm    Post subject: Also Reply with quote

Novice

Joined: 27 Mar 2006
Posts: 14
Location: SF E Bay

I'm running ActiveState perl 5.6.

It's occurred to me that I might want to rip up the current installation; install 5.8; and then reinstall the perl MQSeries module.

(although I'd rather not obviously).
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Mon Mar 27, 2006 4:43 pm    Post subject: Re: MGET: "Unable to allocate memory". Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

patrick flaherty wrote:
my $BuggerLength=512;
my $Buffer;

$Buffer = MQGET($Hconn,$Hobj,$MsgDesc,$GetMsgOpts,$BufferLength,$CompCode,$Reason);


Does the Bugger have a length, or the Buffer?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
patrick flaherty
PostPosted: Mon Mar 27, 2006 4:45 pm    Post subject: Reply with quote

Novice

Joined: 27 Mar 2006
Posts: 14
Location: SF E Bay

Ah thanx.

I keep making that mistake for reasons I'm unaware of. (it's curious how when one makes typos, that, for a given word, it's usually the same typo).

pat
Back to top
View user's profile Send private message
patrick flaherty
PostPosted: Mon Mar 27, 2006 4:48 pm    Post subject: Reply with quote

Novice

Joined: 27 Mar 2006
Posts: 14
Location: SF E Bay

And even better.

After making the change, the code now runs properly.

Duh.

Just added a

use strict;

Which, in theory, is something one should never do without in perl.

pat
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Mon Mar 27, 2006 4:49 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

The real problem I'm having is refraining from making any more 'bugger' jokes.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
patrick flaherty
PostPosted: Mon Mar 27, 2006 4:54 pm    Post subject: Reply with quote

Novice

Joined: 27 Mar 2006
Posts: 14
Location: SF E Bay

Well of course. That's the problem isn't it.

Or rather was.

Now the code works.

(you're not English are you?).
Back to top
View user's profile Send private message
patrick flaherty
PostPosted: Mon Mar 27, 2006 4:56 pm    Post subject: Reply with quote

Novice

Joined: 27 Mar 2006
Posts: 14
Location: SF E Bay

I looked the 'other one' up.

Booger.

Am Slang. Couldn't remember how to spell it.
Back to top
View user's profile Send private message
EddieA
PostPosted: Mon Mar 27, 2006 10:44 pm    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

Except, that as a displaced Brit, I can tell you that there's absolutely no correlation between Bugger and Booger.

Cheers,
_________________
Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
Back to top
View user's profile Send private message
Nigelg
PostPosted: Mon Mar 27, 2006 11:37 pm    Post subject: Reply with quote

Grand Master

Joined: 02 Aug 2004
Posts: 1046

Quote:
The real problem I'm having is refraining from making any more 'bugger' jokes.


Why refrain? Let them roll!

If you did not know...

In Britain, bugger (as a verb) is a synonym for sodomise, though this is quite a rare usage.
Usually, the word is used to connotate something fouled (****ed) up.
_________________
MQSeries.net helps those who help themselves..
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Mar 28, 2006 12:35 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

Also used as the British equivalent of "Doh"!

(At least by me!)
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Mar 28, 2006 5:55 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Now, most people would think that a bug in your code is always a right bugger, but the real problem I'm having is that the bugger of his code was the bugger in his code and it's a bugger to have to fix if you don't keep your eye on the bugger itself.

And now he's trying to measure the bugger's length, as if we wanted to draw the bugger out.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » MGET: "Unable to allocate memory".
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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.